Conditions | 5 |
Paths | 16 |
Total Lines | 24 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
21 | public function handle(DomainEvent $event): void |
||
22 | { |
||
23 | if ($event instanceof TriedOpeningAccountForUnknownEntity) { |
||
24 | $this->refusals->addFor( |
||
25 | $event->aggregateId(), |
||
26 | 'Cannot open account for unknown entity' |
||
27 | ); |
||
28 | } |
||
29 | if ($event instanceof TriedStartingMatchForPendingProposal) { |
||
30 | $this->refusals->addFor( |
||
31 | $event->aggregateId(), |
||
32 | 'The proposal is still pending!' |
||
33 | ); |
||
34 | } |
||
35 | if ($event instanceof TriedAcceptingExpiredProposal) { |
||
36 | $this->refusals->addFor( |
||
37 | $event->aggregateId(), |
||
38 | 'The proposal has already expired!' |
||
39 | ); |
||
40 | } |
||
41 | if ($event instanceof TriedAcceptingUnknownProposal) { |
||
42 | $this->refusals->addFor( |
||
43 | $event->aggregateId(), |
||
44 | 'Proposal not found' |
||
45 | ); |
||
49 |