| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function getFactory(string $driver): DaemonFactoryInterface |
||
| 33 | { |
||
| 34 | if (!isset($this->drivers[$driver])) { |
||
| 35 | throw new \InvalidArgumentException('Unknown driver: '.$driver); |
||
| 36 | } |
||
| 37 | |||
| 38 | if (null === $this->drivers[$driver]['object']) { |
||
| 39 | $class = $this->drivers[$driver]['classPath']; |
||
| 40 | $this->drivers[$driver]['object'] = new $class(); |
||
| 41 | } |
||
| 42 | |||
| 43 | return $this->drivers[$driver]['object']; |
||
| 44 | } |
||
| 45 | } |
||
| 46 |