Conditions | 3 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
18 | 2 | public function getHandlersForCommand(Command $command) |
|
19 | { |
||
20 | 2 | $definitions = $this->getCommandHandlersDefinitions(); |
|
21 | |||
22 | 2 | if (!isset($definitions[get_class($command)])) { |
|
23 | 1 | return []; |
|
24 | } |
||
25 | |||
26 | 1 | $handlersForCommand = $definitions[get_class($command)]; |
|
27 | |||
28 | 1 | $result = []; |
|
29 | |||
30 | 1 | foreach ($handlersForCommand as $commandDefinition) { |
|
31 | |||
32 | 1 | list($aggregateClass, $methodName) = $commandDefinition; |
|
33 | |||
34 | 1 | $result[] = new CommandHandlerDescriptor($aggregateClass, $methodName); |
|
35 | } |
||
36 | |||
37 | 1 | return $result; |
|
38 | } |
||
39 | |||
41 | } |