Code Duplication    Length = 9-10 lines in 2 locations

code/GraphQL/FileInterfaceTypeCreator.php 1 location

@@ 73-82 (lines=10) @@
70
        ];
71
    }
72
73
    public function resolveType($object)
74
    {
75
        if ($object instanceof Folder) {
76
            return $this->manager->getType('Folder');
77
        }
78
        if ($object instanceof File) {
79
            return $this->manager->getType('File');
80
        }
81
        return null;
82
    }
83
}
84

code/GraphQL/ReadFileQueryCreator.php 1 location

@@ 34-42 (lines=9) @@
31
                        $this->manager->getType('File'),
32
                        $this->manager->getType('Folder')
33
                    ],
34
                    'resolveType' => function ($object) {
35
                        if ($object instanceof Folder) {
36
                            return $this->manager->getType('Folder');
37
                        }
38
                        if ($object instanceof File) {
39
                            return $this->manager->getType('File');
40
                        }
41
                        return null;
42
                    }
43
                ]);
44
                return $unionType;
45
            })