Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
30 | public function handle(Command $command): void |
||
31 | { |
||
32 | assert($command instanceof OpenAnAccount); |
||
33 | |||
34 | $visitor = $this->visitor->withId($command->visitorId()); |
||
35 | if ($visitor === null) { |
||
36 | $this->eventBag->add(new TriedOpeningAccountForUnknownEntity( |
||
37 | $command->correlationId(), |
||
38 | 'Cannot open account for unknown entity' |
||
39 | )); |
||
40 | return; |
||
41 | } |
||
42 | |||
43 | $this->register($visitor->openAccount($this->newIdentity->generate())); |
||
44 | } |
||
52 |