| Conditions | 3 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 46 | protected function createClient($identifier) |
||
| 47 | { |
||
| 48 | try { |
||
| 49 | $reflection = new \ReflectionClass($identifier); |
||
| 50 | if (!$reflection->isSubclassOf('\PommProject\ModelManager\ModelLayer\ModelLayer')) { |
||
| 51 | throw new ModelLayerException(sprintf("Class '%s' is not a subclass of ModelLayer.", $identifier)); |
||
| 52 | } |
||
| 53 | } catch (\ReflectionException $e) { |
||
| 54 | throw new ModelLayerException(sprintf("Error while loading class '%s' (%s).", $identifier, $e->getMessage())); |
||
| 55 | } |
||
| 56 | |||
| 57 | return new $identifier(); |
||
| 58 | } |
||
| 59 | } |
||
| 60 |