Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.0261 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | 8 | public function get(string $name) |
|
34 | { |
||
35 | 8 | if (!$this->has($name)) { |
|
36 | throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); |
||
37 | } |
||
38 | |||
39 | /** @var Command $command */ |
||
40 | 8 | $command = $this->container->get($this->commandMap[$name]); |
|
41 | 8 | if ($command->getName() !== $name) { |
|
42 | 1 | $command->setName($name); |
|
43 | } |
||
44 | |||
45 | 8 | return $command; |
|
46 | } |
||
64 |