Code Duplication    Length = 6-6 lines in 2 locations

src/Compiler/Definition/DirectiveDelegate.php 1 location

@@ 64-69 (lines=6) @@
61
     */
62
    private function verifyDuplication(DirectiveDefinition $directive, DirectiveLocation $location): void
63
    {
64
        if ($directive->hasLocation($location->getName())) {
65
            $error = 'Could not determine the location %s, because %s already exists';
66
            $error = \sprintf($error, $location, $directive->getLocation($location->getName()));
67
68
            throw (new TypeConflictException($error))->using($this->getCallStack())->in($location);
69
        }
70
    }
71
72
    /**

src/Compiler/Definition/EnumDelegate.php 1 location

@@ 101-106 (lines=6) @@
98
     */
99
    private function verifyDuplication(EnumDefinition $enum, EnumValueDefinition $value): void
100
    {
101
        if ($enum->hasValue($value->getName())) {
102
            $error = 'Could not define %s, because %s already exists';
103
            $error = \sprintf($error, $value, $enum->getValue($value->getName()));
104
105
            throw (new TypeConflictException($error))->using($this->getCallStack())->in($value);
106
        }
107
    }
108
}
109