| Total Complexity | 3 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | abstract class AbstractEvent implements Event |
||
| 21 | { |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var EventId |
||
| 25 | */ |
||
| 26 | protected $eventId; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var DateTimeImmutable |
||
| 30 | */ |
||
| 31 | protected $occurredOn; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Creates an Abstract Event |
||
| 35 | */ |
||
| 36 | public function __construct() |
||
| 37 | { |
||
| 38 | $this->eventId = new EventId(); |
||
| 39 | $this->occurredOn = new DateTimeImmutable(); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Event identifier |
||
| 44 | * |
||
| 45 | * @return EventId |
||
| 46 | */ |
||
| 47 | public function eventId(): EventId |
||
| 48 | { |
||
| 49 | return $this->eventId; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * The date and time that event has occurred |
||
| 54 | * |
||
| 55 | * @return DateTimeImmutable |
||
| 56 | */ |
||
| 57 | public function occurredOn(): DateTimeImmutable |
||
| 60 | } |
||
| 61 | } |
||
| 62 |