Passed
Push — master ( 0971b0...b7d7cf )
by Kirill
03:21
created

FieldDefinition::verify()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
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\Reflection\Definition\Dependent;
11
12
use Railt\Reflection\Contracts\Definition\Dependent\FieldDefinition as FieldDefinitionInterface;
13
use Railt\Reflection\Contracts\Definition\TypeDefinition;
14
use Railt\Reflection\Contracts\Type as TypeInterface;
15
use Railt\Reflection\Definition\Behaviour\HasArguments;
16
use Railt\Reflection\Definition\Behaviour\HasTypeIndication;
17
use Railt\Reflection\Type;
18
19
/**
20
 * Class FieldDefinition
21
 */
22 View Code Duplication
class FieldDefinition extends AbstractDependentTypeDefinition implements FieldDefinitionInterface
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...
23
{
24
    use HasTypeIndication;
25
    use HasArguments;
26
27
    /**
28
     * FieldDefinition constructor.
29
     * @param TypeDefinition $parent
30
     * @param string $name
31
     * @param string $type
32
     */
33
    public function __construct(TypeDefinition $parent, string $name, string $type)
34
    {
35
        parent::__construct($parent, $name);
36
37
        $this->withTypeDefinition($type);
38
    }
39
40
    /**
41
     * @return TypeInterface
42
     */
43
    public static function getType(): TypeInterface
44
    {
45
        return Type::of(Type::FIELD);
46
    }
47
}
48