Code Duplication    Length = 5-5 lines in 2 locations

src/Compiler/Builder/Invocation/DirectiveBuilder.php 2 locations

@@ 58-62 (lines=5) @@
55
        /** @var DirectiveDefinition $definition */
56
        $definition = $directive->getDefinition();
57
58
        if (! ($definition instanceof Definition\DirectiveDefinition)) {
59
            $error = '%s should be a Directive, but %s given';
60
            throw (new TypeConflictException(\sprintf($error, $directive,
61
                $definition)))->throwsIn($directive->getFile(), $rule->getOffset());
62
        }
63
64
        return $definition;
65
    }
@@ 80-84 (lines=5) @@
77
            $name = $ast->getArgumentName();
78
            $argument = $def->getArgument($name);
79
80
            if ($argument === null) {
81
                $error = 'Directive %s does not provide argument %s';
82
                throw (new TypeConflictException(\sprintf($error, $def, $name)))->throwsIn($call->getFile(),
83
                        $ast->getOffset());
84
            }
85
86
            $value = $this->valueOf($argument, $ast->getArgumentValue());
87