Conditions | 7 |
Paths | 5 |
Total Lines | 11 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 7 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
44 | 25 | public function validate($value, $field = null, $allFields = null) |
|
45 | { |
||
46 | // Make sure the array key exists in the data |
||
47 | // This check will only be performed if $field and $allFields are set. Else only the value passed will be tested |
||
48 | 25 | if ( $field === null or ($allFields !== null and ! isset($allFields[$field]))) |
|
49 | { |
||
50 | 14 | return false; |
|
51 | } |
||
52 | |||
53 | 11 | return ($value === 0 or $value === false or ! empty($value) or $value === '0'); |
|
54 | } |
||
55 | |||
57 |