| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function getHandler(string $jobType): HandlerInterface |
||
| 26 | { |
||
| 27 | try { |
||
| 28 | $handler = $this->container->get($this->className($jobType)); |
||
| 29 | } catch (ContainerException $e) { |
||
| 30 | throw new JobException($e->getMessage(), $e->getCode(), $e); |
||
| 31 | } |
||
| 32 | |||
| 33 | if (!$handler instanceof HandlerInterface) { |
||
| 34 | throw new JobException("Unable to resolve job handler for `{$jobType}`"); |
||
| 35 | } |
||
| 36 | |||
| 37 | return $handler; |
||
| 38 | } |
||
| 50 |