| Total Complexity | 4 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 9 | final class RedirectSource implements DomainEventRecorder |
||
| 10 | { |
||
| 11 | use DomainEventRecording; |
||
| 12 | |||
| 13 | private $id; |
||
| 14 | private $redirectedVisitors = []; |
||
| 15 | |||
| 16 | public function __construct(string $id) |
||
| 17 | { |
||
| 18 | $this->id = $id; |
||
| 19 | } |
||
| 20 | |||
| 21 | public function id(): string |
||
| 24 | } |
||
| 25 | |||
| 26 | public function bring(VisitorId $visitor): void |
||
| 27 | { |
||
| 28 | assert(!isset($this->redirectedVisitors[$visitor->id()])); |
||
| 29 | |||
| 30 | $this->redirectedVisitors[$visitor->id()] = $visitor; |
||
| 31 | $this->events[] = new BroughtVisitor($this->id); |
||
| 32 | } |
||
| 33 | |||
| 34 | public function visitorWithId(VisitorId $visitorId): Visitor |
||
| 37 | } |
||
| 38 | } |
||
| 39 |