1 | <?php |
||
19 | class Delimiter |
||
20 | { |
||
21 | /** @var string */ |
||
22 | protected $char; |
||
23 | |||
24 | /** @var int */ |
||
25 | protected $numDelims; |
||
26 | |||
27 | /** @var int */ |
||
28 | protected $origDelims; |
||
29 | |||
30 | /** @var Node */ |
||
31 | protected $inlineNode; |
||
32 | |||
33 | /** @var Delimiter|null */ |
||
34 | protected $previous; |
||
35 | |||
36 | /** @var Delimiter|null */ |
||
37 | protected $next; |
||
38 | |||
39 | /** @var bool */ |
||
40 | protected $canOpen; |
||
41 | |||
42 | /** @var bool */ |
||
43 | protected $canClose; |
||
44 | |||
45 | /** @var bool */ |
||
46 | protected $active; |
||
47 | |||
48 | /** @var int|null */ |
||
49 | protected $index; |
||
50 | |||
51 | /** |
||
52 | * @param string $char |
||
53 | * @param int $numDelims |
||
54 | * @param Node $node |
||
55 | * @param bool $canOpen |
||
56 | * @param bool $canClose |
||
57 | * @param int|null $index |
||
58 | */ |
||
59 | 942 | public function __construct(string $char, int $numDelims, Node $node, bool $canOpen, bool $canClose, ?int $index = null) |
|
70 | |||
71 | /** |
||
72 | * @return bool |
||
73 | */ |
||
74 | 846 | public function canClose(): bool |
|
78 | |||
79 | /** |
||
80 | * @param bool $canClose |
||
81 | * |
||
82 | * @return $this |
||
83 | */ |
||
84 | 3 | public function setCanClose(bool $canClose) |
|
85 | { |
||
86 | 3 | $this->canClose = $canClose; |
|
87 | |||
88 | 3 | return $this; |
|
89 | } |
||
90 | |||
91 | /** |
||
92 | * @return bool |
||
93 | */ |
||
94 | 429 | public function canOpen(): bool |
|
98 | |||
99 | /** |
||
100 | * @param bool $canOpen |
||
101 | * |
||
102 | * @return $this |
||
103 | */ |
||
104 | 3 | public function setCanOpen(bool $canOpen) |
|
105 | { |
||
106 | 3 | $this->canOpen = $canOpen; |
|
107 | |||
108 | 3 | return $this; |
|
109 | } |
||
110 | |||
111 | /** |
||
112 | * @return bool |
||
113 | */ |
||
114 | 432 | public function isActive(): bool |
|
118 | |||
119 | /** |
||
120 | * @param bool $active |
||
121 | * |
||
122 | * @return $this |
||
123 | */ |
||
124 | 27 | public function setActive(bool $active) |
|
130 | |||
131 | /** |
||
132 | * @return string |
||
133 | */ |
||
134 | 918 | public function getChar(): string |
|
138 | |||
139 | /** |
||
140 | * @param string $char |
||
141 | * |
||
142 | * @return $this |
||
143 | */ |
||
144 | 3 | public function setChar(string $char) |
|
145 | { |
||
146 | 3 | $this->char = $char; |
|
147 | |||
148 | 3 | return $this; |
|
149 | } |
||
150 | |||
151 | /** |
||
152 | * @return int|null |
||
153 | */ |
||
154 | 240 | public function getIndex(): ?int |
|
158 | |||
159 | /** |
||
160 | * @param int|null $index |
||
161 | * |
||
162 | * @return $this |
||
163 | */ |
||
164 | 3 | public function setIndex(?int $index) |
|
165 | { |
||
166 | 3 | $this->index = $index; |
|
167 | |||
168 | 3 | return $this; |
|
169 | } |
||
170 | |||
171 | /** |
||
172 | * @return Delimiter|null |
||
173 | */ |
||
174 | 915 | public function getNext(): ?self |
|
178 | |||
179 | /** |
||
180 | * @param Delimiter|null $next |
||
181 | * |
||
182 | * @return $this |
||
183 | */ |
||
184 | 525 | public function setNext(?self $next) |
|
190 | |||
191 | /** |
||
192 | * @return int |
||
193 | */ |
||
194 | 357 | public function getNumDelims(): int |
|
198 | |||
199 | /** |
||
200 | * @param int $numDelims |
||
201 | * |
||
202 | * @return $this |
||
203 | */ |
||
204 | 354 | public function setNumDelims(int $numDelims) |
|
210 | |||
211 | /** |
||
212 | * @return int |
||
213 | */ |
||
214 | 81 | public function getOrigDelims(): int |
|
218 | |||
219 | /** |
||
220 | * @return Node |
||
221 | */ |
||
222 | 660 | public function getInlineNode(): Node |
|
226 | |||
227 | /** |
||
228 | * @param Node $node |
||
229 | * |
||
230 | * @return $this |
||
231 | */ |
||
232 | 3 | public function setInlineNode(Node $node) |
|
233 | { |
||
234 | 3 | $this->inlineNode = $node; |
|
235 | |||
236 | 3 | return $this; |
|
237 | } |
||
238 | |||
239 | /** |
||
240 | * @return Delimiter|null |
||
241 | */ |
||
242 | 915 | public function getPrevious(): ?self |
|
246 | |||
247 | /** |
||
248 | * @param Delimiter|null $previous |
||
249 | * |
||
250 | * @return $this |
||
251 | */ |
||
252 | 915 | public function setPrevious(?self $previous) |
|
258 | } |
||
259 |