Code Duplication    Length = 28-31 lines in 2 locations

src/Language/Node/FragmentDefinition.php 1 location

@@ 8-35 (lines=28) @@
5
use Fubhy\GraphQL\Language\Location;
6
use Fubhy\GraphQL\Language\Node;
7
8
class FragmentDefinition extends Node implements DefinitionInterface
9
{
10
    const KIND = Node::KIND_FRAGMENT_DEFINITION;
11
12
    /**
13
     * Constructor.
14
     *
15
     * @param \Fubhy\GraphQL\Language\Node\Name $name
16
     * @param \Fubhy\GraphQL\Language\Node\NamedType $typeCondition
17
     * @param \Fubhy\GraphQL\Language\Node\Directive[] $directives
18
     * @param \Fubhy\GraphQL\Language\Node\SelectionSet $selectionSet
19
     * @param \Fubhy\GraphQL\Language\Location $location
20
     */
21
    public function __construct(
22
        Name $name,
23
        NamedType $typeCondition,
24
        array $directives = [],
25
        SelectionSet $selectionSet,
26
        Location $location = NULL
27
    ) {
28
        parent::__construct($location, [
29
            'name' => $name,
30
            'typeCondition' => $typeCondition,
31
            'directives' => $directives,
32
            'selectionSet' => $selectionSet,
33
        ]);
34
    }
35
}
36

src/Language/Node/OperationDefinition.php 1 location

@@ 8-38 (lines=31) @@
5
use Fubhy\GraphQL\Language\Location;
6
use Fubhy\GraphQL\Language\Node;
7
8
class OperationDefinition extends Node implements DefinitionInterface
9
{
10
    const KIND = Node::KIND_OPERATION_DEFINITION;
11
12
    /**
13
     * Constructor.
14
     *
15
     * @param string $operation
16
     * @param \Fubhy\GraphQL\Language\Node\Name $name
17
     * @param \Fubhy\GraphQL\Language\Node\VariableDefinition[] $variableDefinitions
18
     * @param \Fubhy\GraphQL\Language\Node\Directive[] $directives
19
     * @param \Fubhy\GraphQL\Language\Node\SelectionSet $selectionSet
20
     * @param \Fubhy\GraphQL\Language\Location $location
21
     */
22
    public function __construct(
23
        $operation,
24
        Name $name = NULL,
25
        array $variableDefinitions = [],
26
        array $directives = [],
27
        SelectionSet $selectionSet,
28
        Location $location = NULL
29
    ) {
30
        parent::__construct($location, [
31
            'operation' => $operation,
32
            'name' => $name,
33
            'variableDefinitions' => $variableDefinitions,
34
            'directives' => $directives,
35
            'selectionSet' => $selectionSet,
36
        ]);
37
    }
38
}
39