Conditions | 3 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
36 | 4 | public function ensurePropertyNameHasKey(Resource $resource, $value, $name, $key) |
|
37 | { |
||
38 | 4 | if ($resource->get($name) === $value && $resource->hasNotProperty($key)) { |
|
39 | 2 | throw new \Sensorario\Resources\Exceptions\PropertyException( |
|
40 | 2 | 'When property `' . $name . '` ' |
|
41 | 2 | . 'has value ' . '`' . $value . '` ' |
|
42 | 2 | . 'also `' . $key . '` is mandatory' |
|
43 | ); |
||
44 | } |
||
45 | 3 | } |
|
46 | } |
||
47 |