Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 8.7414 |
Changes | 0 |
1 | <?php |
||
19 | 12 | public function check(Resource $resource) |
|
20 | { |
||
21 | 12 | foreach ($resource->properties() as $key => $value) { |
|
22 | 8 | if (isset($resource->ranges()[$key])) { |
|
23 | if ($value < $resource->ranges()[$key]['more_than']) { |
||
24 | throw new \Sensorario\Resources\Exceptions\OutOfRangeException( |
||
25 | 'Value `' . $value . '` is out of range: ' |
||
26 | . '`' |
||
27 | . $resource->ranges()[$key]['more_than'] |
||
28 | . ' to ' |
||
29 | . $resource->ranges()[$key]['more_than'] |
||
30 | . '`.' |
||
31 | ); |
||
32 | } |
||
33 | } |
||
34 | } |
||
35 | 12 | } |
|
36 | } |
||
37 |