1 | <?php |
||
19 | class TypeHintNode extends Rule |
||
20 | { |
||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private const HINT_LIST = 'ListTypeHint'; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private const HINT_SINGULAR = 'SingularTypeHint'; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | private const HINT_NOT_NULL = 'NonNull'; |
||
35 | /** |
||
36 | * @var int |
||
37 | */ |
||
38 | protected $modifiers = 0; |
||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $definition; |
||
43 | |||
44 | /** |
||
45 | * TypeHintNode constructor. |
||
46 | * @param string $name |
||
47 | * @param array $children |
||
48 | * @param int $offset |
||
49 | */ |
||
50 | public function __construct(string $name, $children = [], int $offset = 0) |
||
62 | |||
63 | /** |
||
64 | * @param RuleInterface $rule |
||
65 | * @return bool |
||
66 | */ |
||
67 | private function isListTypeHint(RuleInterface $rule): bool |
||
71 | |||
72 | /** |
||
73 | * @param RuleInterface $rule |
||
74 | */ |
||
75 | private function parseListTypeHint(RuleInterface $rule): void |
||
91 | |||
92 | /** |
||
93 | * @param RuleInterface $rule |
||
94 | */ |
||
95 | private function parseInnerTypeHint(RuleInterface $rule): void |
||
110 | |||
111 | /** |
||
112 | * @return string |
||
113 | */ |
||
114 | public function getTypeName(): string |
||
118 | |||
119 | /** |
||
120 | * @return int |
||
121 | */ |
||
122 | public function getModifiers(): int |
||
126 | } |
||
127 |