Code Duplication    Length = 9-10 lines in 2 locations

code/GraphQL/FileInterfaceTypeCreator.php 1 location

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

code/GraphQL/ReadFileQueryCreator.php 1 location

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