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); |
||
21 | 1 | public function getHandlerForCommand($commandName) |
|
22 | { |
||
23 | 1 | $namespaceParts = explode('\\', $commandName); |
|
24 | |||
25 | 1 | $commandClassName = array_pop($namespaceParts); |
|
26 | 1 | array_pop($namespaceParts); // remove 'Command' namespace part |
|
27 | |||
28 | 1 | $namespaceParts[] = self::COMMAND_HANDLER_NAMESPACE_PART; |
|
29 | 1 | $namespaceParts[] = $commandClassName . self::COMMAND_HANDLER_CLASS_SUFFIX; |
|
30 | |||
31 | 1 | $handlerName = implode('\\', $namespaceParts); |
|
32 | |||
33 | 1 | return $this->container->get($handlerName); |
|
34 | } |
||
36 |