Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
67 | public function validate(array $values) : bool |
||
68 | 2 | { |
|
69 | $data = $this->validateKeys ? array_keys($values) : array_values($values); |
||
70 | $diff = array_diff($data, $this->availableValues); |
||
71 | |||
72 | if (!empty($diff)) { |
||
73 | $this->errors[] = sprintf("Some data is out of range: %s", implode(', ', $diff)); |
||
74 | return false; |
||
75 | } |
||
76 | 2 | ||
77 | $this->validData = $values; |
||
78 | 2 | ||
79 | return true; |
||
80 | } |
||
102 |