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