| Conditions | 7 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function dispatch(Command $command) |
||
| 31 | { |
||
| 32 | $definition = $this->definitions->getDefinition($command->getEntity()); |
||
| 33 | |||
| 34 | if ($command instanceof NewCommand && $definition->hasNewCommandHandler()) { |
||
| 35 | return $definition->getNewCommandHandler()->handle($command); |
||
| 36 | } |
||
| 37 | |||
| 38 | if ($command instanceof EditCommand && $definition->hasEditCommandHandler()) { |
||
| 39 | return $definition->getEditCommandHandler()->handle($command); |
||
| 40 | } |
||
| 41 | |||
| 42 | if ($command instanceof RemoveCommand && $definition->hasRemoveCommandHandler()) { |
||
| 43 | return $definition->getRemoveCommandHandler()->handle($command); |
||
| 44 | } |
||
| 45 | } |
||
| 46 | } |
||
| 47 |