mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-16 20:03:58 +02:00
PHP8
This commit is contained in:
@@ -13,8 +13,6 @@ use InvalidArgumentException;
|
||||
*/
|
||||
class PostId
|
||||
{
|
||||
private int $id;
|
||||
|
||||
public static function fromInt(int $id): PostId
|
||||
{
|
||||
self::ensureIsValid($id);
|
||||
@@ -22,9 +20,8 @@ class PostId
|
||||
return new self($id);
|
||||
}
|
||||
|
||||
private function __construct(int $id)
|
||||
private function __construct(private int $id)
|
||||
{
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function toInt(): int
|
||||
|
Reference in New Issue
Block a user