mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-13 10:24:00 +02:00
PHP8
This commit is contained in:
@@ -21,9 +21,6 @@ class PostStatus
|
||||
self::STATE_PUBLISHED_ID => self::STATE_PUBLISHED,
|
||||
];
|
||||
|
||||
private int $id;
|
||||
private string $name;
|
||||
|
||||
public static function fromInt(int $statusId)
|
||||
{
|
||||
self::ensureIsValidId($statusId);
|
||||
@@ -43,10 +40,8 @@ class PostStatus
|
||||
return new self($state, $status);
|
||||
}
|
||||
|
||||
private function __construct(int $id, string $name)
|
||||
private function __construct(private int $id, private string $name)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->name = $name;
|
||||
}
|
||||
|
||||
public function toInt(): int
|
||||
|
Reference in New Issue
Block a user