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 ConditionProcessor |
||
43 | */ |
||
44 | private $conditionProcessor; |
||
45 | |||
46 | /** |
||
47 | * @var bool |
||
48 | */ |
||
49 | private $dependenciesWereInjected = false; |
||
50 | |||
51 | /** |
||
52 | * @param NodeInterface $rootNode |
||
53 | * @param Result $validationResult |
||
54 | */ |
||
55 | public function __construct(NodeInterface $rootNode, Result $validationResult) |
||
62 | |||
63 | /** |
||
64 | * @param ConditionProcessor $conditionProcessor |
||
65 | * @param ActivationInterface $activation |
||
66 | * @return $this |
||
67 | */ |
||
68 | public function injectDependencies(ConditionProcessor $conditionProcessor, ActivationInterface $activation) |
||
85 | |||
86 | /** |
||
87 | * Allows to go through all the nodes and sub-nodes of the tree. The |
||
88 | * callback is called for every node, with a unique argument: the node |
||
89 | * instance. |
||
90 | * |
||
91 | * @param callable $callback |
||
92 | */ |
||
93 | public function alongNodes(callable $callback) |
||
97 | |||
98 | /** |
||
99 | * @return array |
||
100 | */ |
||
101 | public function getCssConditions() |
||
105 | |||
106 | /** |
||
107 | * @return array |
||
108 | */ |
||
109 | public function getJavaScriptConditions() |
||
113 | |||
114 | /** |
||
115 | * @param PhpConditionDataObject $dataObject |
||
116 | * @return bool |
||
117 | */ |
||
118 | public function getPhpResult(PhpConditionDataObject $dataObject) |
||
122 | |||
123 | /** |
||
124 | * @return Result |
||
125 | */ |
||
126 | public function getValidationResult() |
||
130 | |||
131 | /** |
||
132 | * @return ConditionProcessor |
||
133 | */ |
||
134 | public function getConditionProcessor() |
||
138 | |||
139 | /** |
||
140 | * Resetting the dependencies injection. |
||
141 | */ |
||
142 | public function __wakeup() |
||
146 | } |
||
147 |