1 | <?php |
||
21 | class ConditionNode extends AbstractNode |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $conditionName; |
||
28 | |||
29 | /** |
||
30 | * @var AbstractConditionItem |
||
31 | */ |
||
32 | protected $condition; |
||
33 | |||
34 | /** |
||
35 | * Contains a list of all condition classes which where used since the |
||
36 | * function `distinctUsedConditions()` was called. |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | protected static $distinctUsedConditions = []; |
||
41 | |||
42 | /** |
||
43 | * Constructor, which needs a name for the condition and an instance of a |
||
44 | * condition item. |
||
45 | * |
||
46 | * @param string $conditionName Name of the condition. |
||
47 | * @param AbstractConditionItem $condition Instance of the condition item. |
||
48 | */ |
||
49 | public function __construct($conditionName, AbstractConditionItem $condition) |
||
56 | |||
57 | /** |
||
58 | * @inheritdoc |
||
59 | */ |
||
60 | public function getCssResult() |
||
64 | |||
65 | /** |
||
66 | * @inheritdoc |
||
67 | */ |
||
68 | public function getJavaScriptResult() |
||
72 | |||
73 | /** |
||
74 | * @inheritdoc |
||
75 | */ |
||
76 | public function getPhpResult() |
||
85 | |||
86 | /** |
||
87 | * Resets the list of distinct condition classes. Use the function |
||
88 | * `getDistinctUsedConditions()` to get them. |
||
89 | */ |
||
90 | public static function distinctUsedConditions() |
||
94 | |||
95 | /** |
||
96 | * @return array |
||
97 | */ |
||
98 | public static function getDistinctUsedConditions() |
||
102 | } |
||
103 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.