Conditions | 4 |
Paths | 3 |
Total Lines | 6 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 4.25 |
Changes | 0 |
1 | <?php |
||
40 | 1 | public function getFactory($entityType) { |
|
41 | 1 | if (!isset($this->factories[$entityType]) && !($this->defaultFactory instanceof FactoryInterface)) { |
|
42 | 1 | throw new \Exception('No factory registered for ' . $entityType . ' and no default factory configured.'); |
|
43 | } |
||
44 | return isset($this->factories[$entityType]) ? $this->factories[$entityType] : $this->defaultFactory; |
||
45 | } |
||
46 | |||
55 |