OperationDefinition::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 13

Duplication

Lines 16
Ratio 100 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 16
loc 16
ccs 9
cts 9
cp 1
rs 9.4285
cc 1
eloc 13
nc 1
nop 6
crap 1
1
<?php
2
3
namespace Fubhy\GraphQL\Language\Node;
4
5
use Fubhy\GraphQL\Language\Location;
6
use Fubhy\GraphQL\Language\Node;
7
8 View Code Duplication
class OperationDefinition extends Node implements DefinitionInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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 309
    public function __construct(
23
        $operation,
24
        Name $name = NULL,
25
        array $variableDefinitions = [],
26
        array $directives = [],
27
        SelectionSet $selectionSet,
28
        Location $location = NULL
29
    ) {
30 309
        parent::__construct($location, [
31 309
            'operation' => $operation,
32 309
            'name' => $name,
33 309
            'variableDefinitions' => $variableDefinitions,
34 309
            'directives' => $directives,
35 309
            'selectionSet' => $selectionSet,
36 309
        ]);
37 309
    }
38
}
39