Passed
Push — master ( 81686d...1595cb )
by Kirill
04:41
created

TypeDefinitionNode   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 5
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of Railt package.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Railt\SDL\Frontend\Ast\Definition\Type;
13
14
use Railt\SDL\Frontend\Ast\Definition\TypeSystemDefinitionNode;
15
use Railt\SDL\Frontend\Ast\Executable\DirectiveNode;
16
use Railt\SDL\Frontend\Ast\Identifier;
17
use Railt\TypeSystem\Value\StringValue;
18
19
/**
20
 * Class TypeDefinitionNode
21
 *
22
 * <code>
23
 *  export type TypeDefinitionNode =
24
 *      | ScalarTypeDefinitionNode
25
 *      | ObjectTypeDefinitionNode
26
 *      | InterfaceTypeDefinitionNode
27
 *      | UnionTypeDefinitionNode
28
 *      | EnumTypeDefinitionNode
29
 *      | InputObjectTypeDefinitionNode
30
 *  ;
31
 * </code>
32
 */
33
abstract class TypeDefinitionNode extends TypeSystemDefinitionNode
34
{
35
    /**
36
     * @var Identifier
37
     */
38
    public Identifier $name;
39
40
    /**
41
     * @var StringValue|null
42
     */
43
    public ?StringValue $description = null;
44
45
    /**
46
     * @var DirectiveNode[]
47
     */
48
    public array $directives = [];
49
50
    /**
51
     * TypeDefinitionNode constructor.
52
     *
53
     * @param Identifier $name
54
     */
55
    public function __construct(Identifier $name)
56
    {
57
        $this->name = $name;
58
    }
59
}
60