Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
46 | public function getHandlerForCommand($command) |
||
47 | { |
||
48 | $namespaces = $this->config->get('tactician.namespaces', []); |
||
49 | |||
50 | $handler = sprintf( |
||
51 | '%s\\%sHandler', |
||
52 | $namespaces['handlers'], |
||
53 | trim(str_ireplace($namespaces['commands'], '', $command), '\\') |
||
54 | ); |
||
55 | |||
56 | if (! class_exists($handler)) { |
||
57 | throw MissingHandlerException::forCommand($handler); |
||
58 | } |
||
59 | |||
60 | return $this->container->make($handler); |
||
61 | } |
||
62 | } |
||
63 |