Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
30 | 4 | public function add(object $handler): void |
|
31 | { |
||
32 | 4 | $handlerClass = \get_class($handler); |
|
33 | |||
34 | 4 | if (false === $this->stringEndsWith($handlerClass, 'Handler')) { |
|
35 | 1 | throw new CommandHandlerClassNameDoesNotEndWithHandler(); |
|
36 | } |
||
37 | |||
38 | 3 | $commandClass = $this->getCommandClass($handlerClass); |
|
39 | |||
40 | 3 | $this->map[$commandClass] = $handler; |
|
41 | 3 | } |
|
42 | |||
57 |