Conditions | 3 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
47 | 4 | public function ensurePropertyNameHasKey(Resource $resource, $value, $name, $key) |
|
48 | { |
||
49 | 4 | if ($resource->get($name) === $value && $resource->hasNotProperty($key)) { |
|
50 | 2 | throw new \Sensorario\Resources\Exceptions\PropertyException( |
|
51 | 2 | 'When property `' . $name . '` ' |
|
52 | 2 | . 'has value ' . '`' . $value . '` ' |
|
53 | 2 | . 'also `' . $key . '` is mandatory' |
|
54 | ); |
||
55 | } |
||
56 | 3 | } |
|
57 | } |
||
58 |