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