1 | <?php |
||
7 | trait HasValidationRulesTrait |
||
8 | { |
||
9 | |||
10 | /** |
||
11 | * Get the element value validation rules |
||
12 | * |
||
13 | * @return array |
||
14 | */ |
||
15 | 9 | public function getValidationRules() |
|
19 | |||
20 | /** |
||
21 | * Set the element value validation rules |
||
22 | * |
||
23 | * @param array $rules |
||
24 | * |
||
25 | * @return $this |
||
26 | */ |
||
27 | 5 | public function setValidationRules($rules = array()) |
|
33 | |||
34 | /** |
||
35 | * Adds the element's validation rules to the validator object |
||
36 | * |
||
37 | * @param InputFilter $input |
||
38 | * |
||
39 | * @throws \InvalidArgumentException |
||
40 | */ |
||
41 | 9 | protected function prepareValidator(InputFilter $input) |
|
57 | } |
||
58 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.