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 |
||
29 | 8 | public function get(string $name) |
|
30 | { |
||
31 | 8 | if (!$this->has($name)) { |
|
32 | throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); |
||
33 | } |
||
34 | |||
35 | /** @var Command $command */ |
||
36 | 8 | $command = $this->container->get($this->commandMap[$name]); |
|
37 | 8 | if ($command->getName() !== $name) { |
|
38 | 1 | $command->setName($name); |
|
39 | } |
||
40 | |||
41 | 8 | return $command; |
|
42 | } |
||
60 |