Conditions | 5 |
Paths | 9 |
Total Lines | 17 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | public function handle($command) |
||
34 | { |
||
35 | /** @var DummyAggregate $aggregate */ |
||
36 | $aggregate = $this->repository->retrieve($command->aggregateRootId()); |
||
37 | |||
38 | try { |
||
39 | if ($command instanceof DummyCommand) { |
||
|
|||
40 | $aggregate->performDummyTask(); |
||
41 | } elseif ($command instanceof IgnoredCommand) { |
||
42 | $aggregate->dontDoAnything(); |
||
43 | } elseif ($command instanceof ExceptionInducingCommand) { |
||
44 | $aggregate->throwAnException(); |
||
45 | } elseif ($command instanceof DummyIncrementCommand) { |
||
46 | $aggregate->increment(); |
||
47 | } |
||
48 | } finally { |
||
49 | $this->repository->persist($aggregate); |
||
50 | } |
||
53 |