Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
69 | private function wire(string $channel, $handler): ?Autowire |
||
70 | { |
||
71 | if ($handler instanceof Autowire) { |
||
72 | return $handler; |
||
73 | } |
||
74 | |||
75 | if (is_string($handler)) { |
||
76 | return new Autowire($handler); |
||
77 | } |
||
78 | |||
79 | if (isset($handler['class'])) { |
||
80 | return new Autowire($handler['class'], $handler['options'] ?? []); |
||
81 | } |
||
82 | |||
83 | throw new ConfigException("Invalid handler definition for channel `{$channel}`."); |
||
84 | } |
||
86 |