Conditions | 2 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 3.372 |
Changes | 0 |
1 | <?php |
||
22 | 1 | public function build(string $class, MapInterface $properties) |
|
23 | { |
||
24 | try { |
||
25 | 1 | $refl = new \ReflectionClass($class); |
|
26 | |||
27 | 1 | return $refl->newInstanceWithoutConstructor(); |
|
28 | } catch (\TypeError $e) { |
||
29 | throw new InstanciationFailedException( |
||
30 | sprintf( |
||
31 | 'Class "%s" cannot be instanciated', |
||
32 | $class |
||
33 | ), |
||
34 | $e->getCode(), |
||
35 | $e |
||
36 | ); |
||
48 |