1 | <?php |
||
15 | trait ValidateTrait |
||
16 | { |
||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $validationErrors = []; |
||
21 | |||
22 | /** |
||
23 | * Validates the specified data based on the validation rules. |
||
24 | * |
||
25 | * @param array $data |
||
26 | * @return boolean |
||
27 | */ |
||
28 | 3 | public function validate(array $data = []) |
|
44 | |||
45 | /** |
||
46 | * Returns a listing of error messages. |
||
47 | * |
||
48 | * @return array |
||
49 | */ |
||
50 | public function validationErrors() |
||
54 | } |
||
55 |
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.