Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 2.0625 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
20 | 1 | public function execute(string $commandName, CommandParams $params, CommandExecutionContext $executionContext): string |
|
21 | { |
||
22 | 1 | if (!array_key_exists($commandName, $this->commands)) { |
|
23 | throw new UnknownCommandException("Command '$commandName' must be registered before it can be used."); |
||
24 | } |
||
25 | |||
26 | 1 | return $this->commands[$commandName]->execute($params, $executionContext); |
|
27 | } |
||
28 | } |
||
29 |