Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
65 | public function getHandler(): ?Autowire |
||
66 | { |
||
67 | if (empty($this->config['handler'])) { |
||
68 | return null; |
||
69 | } |
||
70 | |||
71 | if ($this->config['handler'] instanceof Autowire) { |
||
72 | return $this->config['handler']; |
||
73 | } |
||
74 | |||
75 | if (class_exists($this->config['handler'])) { |
||
76 | return new Autowire($this->config['handler']); |
||
77 | } |
||
78 | |||
79 | $handler = $this->config['handlers'][$this->config['handler']]; |
||
80 | |||
81 | return new Autowire($handler['class'], $handler['options']); |
||
82 | } |
||
92 |