1 | <?php |
||
15 | class Rule extends Node implements RuleInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var array|iterable|\Traversable |
||
19 | */ |
||
20 | protected $children; |
||
21 | |||
22 | /** |
||
23 | * Rule constructor. |
||
24 | * @param string $name |
||
25 | * @param iterable $children |
||
26 | */ |
||
27 | 54 | public function __construct(string $name, iterable $children = [], int $offset = 0) |
|
32 | |||
33 | /** |
||
34 | * @return array |
||
35 | */ |
||
36 | 54 | public function getChildren(): array |
|
44 | |||
45 | /** |
||
46 | * @param int $index |
||
47 | * @return null|NodeInterface |
||
48 | */ |
||
49 | public function getChild(int $index): ?NodeInterface |
||
53 | |||
54 | /** |
||
55 | * @return bool |
||
56 | */ |
||
57 | public function hasChildren(): bool |
||
61 | |||
62 | /** |
||
63 | * @param NodeInterface $node |
||
64 | */ |
||
65 | public function append(NodeInterface $node): void |
||
71 | |||
72 | /** |
||
73 | * @return null|NodeInterface |
||
74 | */ |
||
75 | public function pop(): ?NodeInterface |
||
79 | |||
80 | /** |
||
81 | * @return int |
||
82 | */ |
||
83 | public function count(): int |
||
87 | |||
88 | /** |
||
89 | * @return \Traversable |
||
90 | */ |
||
91 | public function getIterator(): \Traversable |
||
95 | |||
96 | /** |
||
97 | * @param string $name |
||
98 | * @param int|null $depth |
||
99 | * @return null|NodeInterface |
||
100 | */ |
||
101 | public function find(string $name, int $depth = null): ?NodeInterface |
||
115 | |||
116 | /** |
||
117 | * @return string[]|\Traversable |
||
118 | */ |
||
119 | public function getValue() |
||
131 | } |
||
132 |