Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| BookDeletedEvent | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getBook | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getAggregateId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | // ╔════════════════════════════════════════════════════════════╗ |
| 4 | // ║ MIT Licence (#Expat) - https://opensource.org/licenses/MIT ║ |
| 5 | // ║ Copyright 2026 Frederic Poeydomenge <dyno@phexium.com> ║ |
| 6 | // ╚════════════════════════════════════════════════════════════╝ |
| 7 | |
| 8 | declare(strict_types=1); |
| 9 | |
| 10 | namespace AppDemo\Library\Domain\Event; |
| 11 | |
| 12 | use AppDemo\Library\Domain\Book; |
| 13 | use DateTimeImmutable; |
| 14 | use Phexium\Domain\Event\DomainEventAbstract; |
| 15 | use Phexium\Domain\Id\IdInterface; |
| 16 | |
| 17 | final readonly class BookDeletedEvent extends DomainEventAbstract |
| 18 | { |
| 19 | public function __construct( |
| 20 | IdInterface $eventId, |
| 21 | DateTimeImmutable $occurredOn, |
| 22 | private Book $book, |
| 23 | ) { |
| 24 | parent::__construct($eventId, $occurredOn); |
| 25 | } |
| 26 | |
| 27 | public function getBook(): Book |
| 28 | { |
| 29 | return $this->book; |
| 30 | } |
| 31 | |
| 32 | public function getAggregateId(): IdInterface |
| 33 | { |
| 34 | return $this->book->getId(); |
| 35 | } |
| 36 | } |