1 | <?php |
||
20 | abstract class AbstractTypeDefinition extends AbstractDefinition implements TypeDefinition |
||
21 | { |
||
22 | use HasDirectives; |
||
23 | use HasDeprecation; |
||
24 | use HasInheritance; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $name; |
||
30 | |||
31 | /** |
||
32 | * @var string|null |
||
33 | */ |
||
34 | protected $description; |
||
35 | |||
36 | /** |
||
37 | * AbstractTypeDefinition constructor. |
||
38 | * @param Document|\Railt\Reflection\Contracts\Document $document |
||
39 | * @param string $name |
||
40 | */ |
||
41 | 9 | public function __construct(Document $document, string $name) |
|
42 | { |
||
43 | 9 | $this->name = $name; |
|
44 | |||
45 | 9 | parent::__construct($document); |
|
46 | 9 | } |
|
47 | |||
48 | /** |
||
49 | * @return string |
||
50 | */ |
||
51 | public function getDescription(): string |
||
55 | |||
56 | /** |
||
57 | * @param null|string $description |
||
58 | * @return TypeDefinition|$this |
||
59 | */ |
||
60 | 9 | public function withDescription(?string $description): TypeDefinition |
|
66 | |||
67 | /** |
||
68 | * @param string $name |
||
69 | * @return TypeDefinition|$this |
||
70 | */ |
||
71 | 8 | public function renameTo(string $name): TypeDefinition |
|
77 | |||
78 | /** |
||
79 | * @return string |
||
80 | */ |
||
81 | 25 | public function getName(): string |
|
85 | |||
86 | /** |
||
87 | * @return bool |
||
88 | */ |
||
89 | public function isBuiltin(): bool |
||
93 | |||
94 | /** |
||
95 | * @return string |
||
96 | */ |
||
97 | public function __toString(): string |
||
101 | |||
102 | /** |
||
103 | * @return bool |
||
104 | */ |
||
105 | public function isRenderable(): bool |
||
109 | |||
110 | /** |
||
111 | * @return bool |
||
112 | */ |
||
113 | public function isInputable(): bool |
||
117 | } |
||
118 |