| 1 | <?php |
||
| 6 | class NotificationId |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * @var int |
||
| 10 | */ |
||
| 11 | private $id; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @param int $id |
||
| 15 | */ |
||
| 16 | 3 | public function __construct(int $id) |
|
| 17 | { |
||
| 18 | 3 | $this->id = $id; |
|
| 19 | 3 | } |
|
| 20 | |||
| 21 | /** |
||
| 22 | * @return int |
||
| 23 | */ |
||
| 24 | 3 | public function id(): int |
|
| 25 | { |
||
| 26 | 3 | return $this->id; |
|
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param NotificationId $other |
||
| 31 | * @return bool |
||
| 32 | */ |
||
| 33 | public function equals(NotificationId $other): bool |
||
| 34 | { |
||
| 35 | return $this->id() === $other->id(); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return string |
||
| 40 | */ |
||
| 41 | 3 | public function __toString(): string |
|
| 45 | } |
||
| 46 |