Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php declare(strict_types = 1); |
||
22 | 1 | public function getHandlerForCommand($commandName) |
|
23 | { |
||
24 | 1 | $namespaceParts = explode('\\', $commandName); |
|
25 | |||
26 | 1 | $commandClassName = array_pop($namespaceParts); |
|
27 | 1 | array_pop($namespaceParts); // remove 'Command' namespace part |
|
28 | |||
29 | 1 | $namespaceParts[] = self::COMMAND_HANDLER_NAMESPACE_PART; |
|
30 | 1 | $namespaceParts[] = $commandClassName . self::COMMAND_HANDLER_CLASS_SUFFIX; |
|
31 | |||
32 | 1 | $handlerName = implode('\\', $namespaceParts); |
|
33 | |||
34 | 1 | return $this->container->get($handlerName); |
|
35 | } |
||
37 |