mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-16 20:03:58 +02:00
PHP8
This commit is contained in:
@@ -4,11 +4,6 @@ namespace DesignPatterns\More\Repository\Domain;
|
||||
|
||||
class Post
|
||||
{
|
||||
private PostId $id;
|
||||
private PostStatus $status;
|
||||
private string $title;
|
||||
private string $text;
|
||||
|
||||
public static function draft(PostId $id, string $title, string $text): Post
|
||||
{
|
||||
return new self(
|
||||
@@ -29,12 +24,12 @@ class Post
|
||||
);
|
||||
}
|
||||
|
||||
private function __construct(PostId $id, PostStatus $status, string $title, string $text)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->status = $status;
|
||||
$this->text = $text;
|
||||
$this->title = $title;
|
||||
private function __construct(
|
||||
private PostId $id,
|
||||
private PostStatus $status,
|
||||
private string $title,
|
||||
private string $text
|
||||
) {
|
||||
}
|
||||
|
||||
public function getId(): PostId
|
||||
|
Reference in New Issue
Block a user