1 | <?php |
||
24 | class BlockDirective extends Directive implements DirectiveInterface, IteratorAggregate |
||
25 | { |
||
26 | /** @var array orderd list of sub directives */ |
||
27 | private $directives = []; |
||
28 | |||
29 | /** |
||
30 | * Adds a Directive at the end of the list. |
||
31 | * |
||
32 | * @param DirectiveInterface $directive a directive to add |
||
33 | */ |
||
34 | 9 | public function add(DirectiveInterface $directive) |
|
40 | |||
41 | /** |
||
42 | * Confirms if the directive contains a specified directive. |
||
43 | * |
||
44 | * @param string $name the directive for which to check existence |
||
45 | * |
||
46 | * @return bool true if the sub-directive exists, false otherwise |
||
47 | */ |
||
48 | 1 | public function hasDirective($name) |
|
62 | |||
63 | /** |
||
64 | * Looks into sub directives to confirm if the actual contains a specified directive. |
||
65 | * |
||
66 | * @param string $name the directive for which to check existence |
||
67 | * @param bool $inSubDirective the actual state |
||
68 | * @param DirectiveInterface $directive the sub directive to look into |
||
69 | * |
||
70 | * @return bool true if the sub-directive exists, false otherwise |
||
71 | */ |
||
72 | 1 | private function hasInnerDirective($name, $inSubDirective, DirectiveInterface $directive) |
|
80 | |||
81 | /** |
||
82 | * Confirms if the directive is simple. |
||
83 | * |
||
84 | * Block directive can have sub directives |
||
85 | * |
||
86 | * @return bool true if the directive is simple, false otherwise |
||
87 | */ |
||
88 | 2 | public function isSimple() |
|
92 | |||
93 | /** |
||
94 | * Gets the sub directives as a Traversable array. |
||
95 | * |
||
96 | * @return ArrayIterator the sub directives |
||
97 | */ |
||
98 | 1 | public function getIterator() |
|
102 | } |
||
103 |