| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | public function __construct($class, $id = null) |
||
| 11 | { |
||
| 12 | $reflection = new ReflectionClass($class); |
||
| 13 | |||
| 14 | $model = $reflection->getShortName(); |
||
| 15 | |||
| 16 | if ($id) { |
||
| 17 | $message = sprintf('Model `%s` not found by id `%s`', $model, $id); |
||
| 18 | } else { |
||
| 19 | $message = sprintf('Model `%s` not found', $model); |
||
| 20 | } |
||
| 21 | |||
| 22 | parent::__construct($message); |
||
| 23 | } |
||
| 24 | } |
||
| 25 |