Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
42 | 11 | public function getFactory(Specification $spec): Factory |
|
43 | { |
||
44 | 11 | if(!isset($this->factories[get_class($spec)])) { |
|
45 | 1 | throw new \OutOfRangeException(sprintf( |
|
46 | 1 | 'Factory for Specification "%s" not registred', |
|
47 | 1 | get_class($spec) |
|
48 | )); |
||
49 | } |
||
50 | |||
51 | 10 | return $this->factories[get_class($spec)]; |
|
52 | } |
||
53 | } |
||
54 |