Test Failed
Push — master ( dbe410...b8c007 )
by Kirill
02:19
created

InputFieldDefinition::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\InputFieldDefinition as InputFieldDefinitionInterface;
13
use Railt\Reflection\Contracts\Definition\TypeDefinition;
14
use Railt\Reflection\Contracts\Type as TypeInterface;
15
use Railt\Reflection\Definition\Behaviour\HasDefaultValue;
16
use Railt\Reflection\Definition\Behaviour\HasTypeIndication;
17
use Railt\Reflection\Common\Verifiable;
18
use Railt\Reflection\Type;
19
20
/**
21
 * Class InputFieldDefinition
22
 */
23 View Code Duplication
class InputFieldDefinition extends AbstractDependentTypeDefinition implements InputFieldDefinitionInterface, Verifiable
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 HasTypeIndication;
26
    use HasDefaultValue;
27
28
    /**
29
     * ArgumentDefinition constructor.
30
     * @param TypeDefinition $parent
31
     * @param string $name
32
     * @param string $type
33
     */
34
    public function __construct(TypeDefinition $parent, string $name, string $type)
35
    {
36
        parent::__construct($parent, $name);
37
38
        $this->withTypeDefinition($type);
39
    }
40
41
    /**
42
     * @throws \Railt\Io\Exception\ExternalFileException
43
     */
44
    public function verify(): void
45
    {
46
        $this->verifyInputType($this->getDefinition());
47
    }
48
49
    /**
50
     * @return TypeInterface
51
     * @throws \Railt\Io\Exception\ExternalFileException
52
     */
53
    public static function getType(): TypeInterface
54
    {
55
        return Type::of(Type::INPUT_FIELD_DEFINITION);
56
    }
57
}
58