1 | <?php |
||
27 | class ConditionTree |
||
28 | { |
||
29 | /** |
||
30 | * @var NodeInterface |
||
31 | */ |
||
32 | private $rootNode; |
||
33 | |||
34 | /** |
||
35 | * @var Result |
||
36 | */ |
||
37 | private $validationResult; |
||
38 | |||
39 | /** |
||
40 | * @var ConditionProcessor |
||
41 | */ |
||
42 | private $conditionProcessor; |
||
43 | |||
44 | /** |
||
45 | * @param NodeInterface $rootNode |
||
46 | * @param Result $validationResult |
||
47 | */ |
||
48 | public function __construct(NodeInterface $rootNode, Result $validationResult) |
||
55 | |||
56 | /** |
||
57 | * @param ConditionProcessor $conditionProcessor |
||
58 | * @return $this |
||
59 | */ |
||
60 | public function attachConditionProcessor(ConditionProcessor $conditionProcessor) |
||
66 | |||
67 | /** |
||
68 | * Allows to go through all the nodes and sub-nodes of the tree. The |
||
69 | * callback is called for every node, with a unique argument: the node |
||
70 | * instance. |
||
71 | * |
||
72 | * @param callable $callback |
||
73 | */ |
||
74 | public function alongNodes(callable $callback) |
||
78 | |||
79 | /** |
||
80 | * @return array |
||
81 | */ |
||
82 | public function getCssConditions() |
||
86 | |||
87 | /** |
||
88 | * @return array |
||
89 | */ |
||
90 | public function getJavaScriptConditions() |
||
94 | |||
95 | /** |
||
96 | * @param PhpConditionDataObject $dataObject |
||
97 | * @return bool |
||
98 | */ |
||
99 | public function getPhpResult(PhpConditionDataObject $dataObject) |
||
103 | |||
104 | /** |
||
105 | * @return Result |
||
106 | */ |
||
107 | public function getValidationResult() |
||
111 | |||
112 | /** |
||
113 | * @return ConditionProcessor |
||
114 | */ |
||
115 | public function getConditionProcessor() |
||
119 | } |
||
120 |