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 |
||
24 | public function getHandler(string $jobType): HandlerInterface |
||
25 | { |
||
26 | try { |
||
27 | $handler = $this->container->get($this->className($jobType)); |
||
28 | } catch (ContainerException $e) { |
||
29 | throw new JobException($e->getMessage(), $e->getCode(), $e); |
||
30 | } |
||
31 | |||
32 | if (!$handler instanceof HandlerInterface) { |
||
33 | throw new JobException("Unable to resolve job handler for `{$jobType}`"); |
||
34 | } |
||
35 | |||
36 | return $handler; |
||
37 | } |
||
47 |