1 | <?php |
||
23 | class ConditionProcessor |
||
24 | { |
||
25 | /** |
||
26 | * @var FormObject |
||
27 | */ |
||
28 | private $formObject; |
||
29 | |||
30 | /** |
||
31 | * @var Form |
||
32 | */ |
||
33 | private $formConfiguration; |
||
34 | |||
35 | /** |
||
36 | * @var ConditionTree[] |
||
37 | */ |
||
38 | private $fieldsTrees = []; |
||
39 | |||
40 | /** |
||
41 | * @var ConditionTree[] |
||
42 | */ |
||
43 | private $validationsTrees = []; |
||
44 | |||
45 | /** |
||
46 | * @param FormObject $formObject |
||
47 | */ |
||
48 | public function __construct(FormObject $formObject) |
||
52 | |||
53 | /** |
||
54 | * Returns the condition tree for a given field instance, giving access to |
||
55 | * CSS, JavaScript and PHP transpiled results. |
||
56 | * |
||
57 | * @param Field $field |
||
58 | * @return ConditionTree |
||
59 | */ |
||
60 | public function getActivationConditionTreeForField(Field $field) |
||
70 | |||
71 | /** |
||
72 | * Returns the condition tree for a given validation instance, giving access |
||
73 | * to CSS, JavaScript and PHP transpiled results. |
||
74 | * |
||
75 | * @param Validation $validation |
||
76 | * @return ConditionTree |
||
77 | */ |
||
78 | public function getActivationConditionTreeForValidation(Validation $validation) |
||
90 | |||
91 | /** |
||
92 | * Function that will calculate all trees from fields and their validation |
||
93 | * rules. |
||
94 | * |
||
95 | * This is useful to be able to store this instance in cache. |
||
96 | */ |
||
97 | public function calculateAllTrees() |
||
108 | |||
109 | /** |
||
110 | * @param FormObject $formObject |
||
111 | */ |
||
112 | public function attachFormObject(FormObject $formObject) |
||
117 | |||
118 | /** |
||
119 | * @return FormObject |
||
120 | */ |
||
121 | public function getFormObject() |
||
125 | |||
126 | /** |
||
127 | * @return array |
||
128 | */ |
||
129 | public function __sleep() |
||
133 | } |
||
134 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.