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