TypeDefinitionNode::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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\SDL\Frontend\Ast\TypeName;
18
use Railt\TypeSystem\Value\StringValue;
19
20
/**
21
 * Class TypeDefinitionNode
22
 *
23
 * <code>
24
 *  export type TypeDefinitionNode =
25
 *      | ScalarTypeDefinitionNode
26
 *      | ObjectTypeDefinitionNode
27
 *      | InterfaceTypeDefinitionNode
28
 *      | UnionTypeDefinitionNode
29
 *      | EnumTypeDefinitionNode
30
 *      | InputObjectTypeDefinitionNode
31
 *  ;
32
 * </code>
33
 */
34
abstract class TypeDefinitionNode extends TypeSystemDefinitionNode
35
{
36
    /**
37
     * @var TypeName
38
     */
39
    public TypeName $name;
40
41
    /**
42
     * @var StringValue|null
43
     */
44
    public ?StringValue $description = null;
45
46
    /**
47
     * @var DirectiveNode[]
48
     */
49
    public array $directives = [];
50
51
    /**
52
     * TypeDefinitionNode constructor.
53
     *
54
     * @param TypeName $name
55
     */
56
    public function __construct(TypeName $name)
57
    {
58
        $this->name = $name;
59
    }
60
}
61