Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
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 |