FragmentDefinition::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 11

Duplication

Lines 14
Ratio 100 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 14
loc 14
ccs 8
cts 8
cp 1
rs 9.4285
cc 1
eloc 11
nc 1
nop 5
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 FragmentDefinition 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_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 36
    public function __construct(
22
        Name $name,
23
        NamedType $typeCondition,
24
        array $directives = [],
25
        SelectionSet $selectionSet,
26
        Location $location = NULL
27
    ) {
28 36
        parent::__construct($location, [
29 36
            'name' => $name,
30 36
            'typeCondition' => $typeCondition,
31 36
            'directives' => $directives,
32 36
            'selectionSet' => $selectionSet,
33 36
        ]);
34 36
    }
35
}
36