| Conditions | 4 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 15 | public function ensureMandatoryPropertyIsValizable($key, $value, $resource) |
|
| 27 | { |
||
| 28 | 15 | if (is_numeric($key) && $resource->hasNotProperty($value) && !isset($resource->defaults()[$value])) { |
|
| 29 | 1 | throw new \Sensorario\Resources\Exceptions\PropertyException( |
|
| 30 | 1 | "Property `" . get_class($resource) . "::\$$value` is mandatory but not set. " |
|
| 31 | 1 | . "Mandatory fields are: " . join(',', $resource->mandatory()) . "." |
|
| 32 | ); |
||
| 33 | } |
||
| 34 | 14 | } |
|
| 35 | } |
||
| 36 |