Completed
Push — master ( c1a156...8cadde )
by Kirill
08:14
created

FieldDefinitionNode   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 16
loc 16
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 5

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 6 6 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\SDL\Ast\Dependent;
11
12
use Railt\Reflection\Contracts\Definition;
13
use Railt\Reflection\Contracts\Definition\TypeDefinition;
14
use Railt\Reflection\Definition\Dependent\FieldDefinition;
15
use Railt\SDL\Ast\ProvidesArgumentNodes;
16
use Railt\SDL\Ast\ProvidesTypeHint;
17
use Railt\SDL\Ast\Support\ArgumentsProvider;
18
use Railt\SDL\Ast\Support\TypeHintProvider;
19
20
/**
21
 * Class FieldDefinitionNode
22
 */
23 View Code Duplication
class FieldDefinitionNode extends DependentTypeDefinitionNode implements ProvidesArgumentNodes, ProvidesTypeHint
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...
24
{
25
    use ArgumentsProvider;
26
    use TypeHintProvider;
27
28
    /**
29
     * @param Definition|TypeDefinition $parent
30
     * @return Definition|FieldDefinition
31
     */
32 6
    public function resolve(Definition $parent): Definition
33
    {
34 6
        \assert($parent instanceof Definition\Behaviour\ProvidesFields);
35
36 6
        return new FieldDefinition($parent, $this->getFullName(), $this->getTypeHintNode()->getFullName());
37
    }
38
}
39