Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
28 | 3 | public function validate(array $data = []) |
|
29 | { |
||
30 | 3 | $this->load->library('form_validation'); |
|
31 | |||
32 | 3 | if (! empty($data)) { |
|
33 | 3 | $this->form_validation->set_data($data); |
|
34 | 3 | } |
|
35 | |||
36 | 3 | $this->form_validation->set_rules($this->validation_rules); |
|
37 | |||
38 | 3 | if ($this->form_validation->run() === false) { |
|
39 | 3 | $this->validationErrors = $this->form_validation->error_array(); |
|
40 | 3 | } |
|
41 | |||
42 | 3 | return $validated; |
|
|
|||
43 | } |
||
44 | |||
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.