1 | <?php |
||
14 | trait CheckTrait |
||
15 | { |
||
16 | /** |
||
17 | * Get field data by field name |
||
18 | * |
||
19 | * @param string $name name for access |
||
20 | * @return mixed |
||
21 | */ |
||
22 | abstract public function get(string $name); |
||
23 | |||
24 | /** |
||
25 | * Check if data satisfies the condition |
||
26 | * @param array $conditions |
||
27 | * @return bool |
||
28 | */ |
||
29 | public function check(array $conditions) : bool |
||
47 | |||
48 | /** |
||
49 | * Check AND condition |
||
50 | * @param array $conditions |
||
51 | * @return bool |
||
52 | */ |
||
53 | private function checkAnd(array $conditions) : bool |
||
62 | |||
63 | /** |
||
64 | * Check OR condition |
||
65 | * @param array $conditions |
||
66 | * @return bool |
||
67 | */ |
||
68 | private function checkOr(array $conditions) : bool |
||
77 | |||
78 | /** |
||
79 | * Check/compare some field by rule and some value |
||
80 | * @param string $staredRule |
||
81 | * @param mixed $arg1 |
||
82 | * @param mixed $arg2 |
||
83 | * @return bool |
||
84 | */ |
||
85 | private function checkField(string $staredRule, $arg1, $arg2) : bool |
||
96 | } |
||
97 |
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.