1 | <?php |
||
29 | class ConditionTree |
||
30 | { |
||
31 | /** |
||
32 | * @var NodeInterface |
||
33 | */ |
||
34 | private $rootNode; |
||
35 | |||
36 | /** |
||
37 | * @var Result |
||
38 | */ |
||
39 | private $validationResult; |
||
40 | |||
41 | /** |
||
42 | * @var bool |
||
43 | */ |
||
44 | private $dependenciesWereInjected = false; |
||
45 | |||
46 | /** |
||
47 | * @param NodeInterface $rootNode |
||
48 | * @param Result $validationResult |
||
49 | */ |
||
50 | public function __construct(NodeInterface $rootNode, Result $validationResult = null) |
||
57 | |||
58 | /** |
||
59 | * Allows to go through all the nodes and sub-nodes of the tree. The |
||
60 | * callback is called for every node, with a unique argument: the node |
||
61 | * instance. |
||
62 | * |
||
63 | * @param callable $callback |
||
64 | */ |
||
65 | public function alongNodes(callable $callback) |
||
69 | |||
70 | /** |
||
71 | * @param ConditionProcessor $conditionProcessor |
||
72 | * @param ActivationInterface $activation |
||
73 | * @return $this |
||
74 | */ |
||
75 | public function injectDependencies(ConditionProcessor $conditionProcessor, ActivationInterface $activation) |
||
90 | |||
91 | /** |
||
92 | * @return array |
||
93 | */ |
||
94 | public function getCssConditions() |
||
98 | |||
99 | /** |
||
100 | * @return array |
||
101 | */ |
||
102 | public function getJavaScriptConditions() |
||
106 | |||
107 | /** |
||
108 | * @param PhpConditionDataObject $dataObject |
||
109 | * @return bool |
||
110 | */ |
||
111 | public function getPhpResult(PhpConditionDataObject $dataObject) |
||
115 | |||
116 | /** |
||
117 | * @return Result |
||
118 | */ |
||
119 | public function getValidationResult() |
||
123 | |||
124 | /** |
||
125 | * Resetting the dependencies injection. |
||
126 | */ |
||
127 | public function __wakeup() |
||
131 | } |
||
132 |