| @@ 26-123 (lines=98) @@ | ||
| 23 | * |
|
| 24 | * @codeCoverageIgnore |
|
| 25 | */ |
|
| 26 | final class LatestPostWithAuthorAndTagsDto implements ConstructableFromArrayInterface |
|
| 27 | { |
|
| 28 | use ConstructableFromArrayTrait; |
|
| 29 | ||
| 30 | /** |
|
| 31 | * @var string |
|
| 32 | */ |
|
| 33 | private $title; |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @var DateTimeInterface |
|
| 37 | */ |
|
| 38 | private $publishedAt; |
|
| 39 | ||
| 40 | /** |
|
| 41 | * @var string |
|
| 42 | */ |
|
| 43 | private $summary; |
|
| 44 | ||
| 45 | /** |
|
| 46 | * @var string |
|
| 47 | */ |
|
| 48 | private $slug; |
|
| 49 | ||
| 50 | /** |
|
| 51 | * @var string |
|
| 52 | */ |
|
| 53 | private $authorFullName; |
|
| 54 | ||
| 55 | /** |
|
| 56 | * @var string[] |
|
| 57 | */ |
|
| 58 | private $tagList; |
|
| 59 | ||
| 60 | /** |
|
| 61 | * @var string |
|
| 62 | */ |
|
| 63 | private $authorEmail; |
|
| 64 | ||
| 65 | /** |
|
| 66 | * @throws \Exception |
|
| 67 | */ |
|
| 68 | public function __construct( |
|
| 69 | string $title, |
|
| 70 | DateTimeInterface $publishedAt, |
|
| 71 | string $summary, |
|
| 72 | string $slug, |
|
| 73 | string $authorFullName, |
|
| 74 | string $authorEmail, |
|
| 75 | string ...$tagList |
|
| 76 | ) { |
|
| 77 | $this->title = $title; |
|
| 78 | $this->publishedAt = $publishedAt; |
|
| 79 | $this->summary = $summary; |
|
| 80 | $this->slug = $slug; |
|
| 81 | $this->authorFullName = $authorFullName; |
|
| 82 | $this->authorEmail = $authorEmail; |
|
| 83 | $this->tagList = $tagList; |
|
| 84 | } |
|
| 85 | ||
| 86 | public function getTitle(): string |
|
| 87 | { |
|
| 88 | return $this->title; |
|
| 89 | } |
|
| 90 | ||
| 91 | public function getPublishedAt(): DateTimeInterface |
|
| 92 | { |
|
| 93 | return $this->publishedAt; |
|
| 94 | } |
|
| 95 | ||
| 96 | public function getSummary(): string |
|
| 97 | { |
|
| 98 | return $this->summary; |
|
| 99 | } |
|
| 100 | ||
| 101 | public function getSlug(): string |
|
| 102 | { |
|
| 103 | return $this->slug; |
|
| 104 | } |
|
| 105 | ||
| 106 | public function getAuthorFullName(): string |
|
| 107 | { |
|
| 108 | return $this->authorFullName; |
|
| 109 | } |
|
| 110 | ||
| 111 | public function getAuthorEmail(): string |
|
| 112 | { |
|
| 113 | return $this->authorEmail; |
|
| 114 | } |
|
| 115 | ||
| 116 | /** |
|
| 117 | * @return string[] |
|
| 118 | */ |
|
| 119 | public function getTagList(): array |
|
| 120 | { |
|
| 121 | return $this->tagList; |
|
| 122 | } |
|
| 123 | } |
|
| 124 | ||
| @@ 27-121 (lines=95) @@ | ||
| 24 | * |
|
| 25 | * @codeCoverageIgnore |
|
| 26 | */ |
|
| 27 | final class PostWithAuthorDto implements ConstructableFromArrayInterface |
|
| 28 | { |
|
| 29 | use ConstructableFromArrayTrait; |
|
| 30 | ||
| 31 | /** |
|
| 32 | * @var string |
|
| 33 | */ |
|
| 34 | private $title; |
|
| 35 | ||
| 36 | /** |
|
| 37 | * @var string |
|
| 38 | */ |
|
| 39 | private $slug; |
|
| 40 | ||
| 41 | /** |
|
| 42 | * @var UserId |
|
| 43 | */ |
|
| 44 | private $authorId; |
|
| 45 | ||
| 46 | /** |
|
| 47 | * @var string |
|
| 48 | */ |
|
| 49 | private $authorMobile; |
|
| 50 | ||
| 51 | /** |
|
| 52 | * @var string |
|
| 53 | */ |
|
| 54 | private $authorFullName; |
|
| 55 | ||
| 56 | /** |
|
| 57 | * @var string |
|
| 58 | */ |
|
| 59 | private $authorEmail; |
|
| 60 | ||
| 61 | /** |
|
| 62 | * @var PostId |
|
| 63 | */ |
|
| 64 | private $id; |
|
| 65 | ||
| 66 | /** |
|
| 67 | * @throws \Exception |
|
| 68 | */ |
|
| 69 | public function __construct( |
|
| 70 | PostId $id, |
|
| 71 | string $title, |
|
| 72 | string $slug, |
|
| 73 | UserId $authorId, |
|
| 74 | string $authorMobile, |
|
| 75 | string $authorFullName, |
|
| 76 | string $authorEmail |
|
| 77 | ) { |
|
| 78 | $this->id = $id; |
|
| 79 | $this->title = $title; |
|
| 80 | $this->slug = $slug; |
|
| 81 | $this->authorId = $authorId; |
|
| 82 | $this->authorMobile = $authorMobile; |
|
| 83 | $this->authorFullName = $authorFullName; |
|
| 84 | $this->authorEmail = $authorEmail; |
|
| 85 | } |
|
| 86 | ||
| 87 | public function getId(): PostId |
|
| 88 | { |
|
| 89 | return $this->id; |
|
| 90 | } |
|
| 91 | ||
| 92 | public function getTitle(): string |
|
| 93 | { |
|
| 94 | return $this->title; |
|
| 95 | } |
|
| 96 | ||
| 97 | public function getSlug(): string |
|
| 98 | { |
|
| 99 | return $this->slug; |
|
| 100 | } |
|
| 101 | ||
| 102 | public function getAuthorId(): UserId |
|
| 103 | { |
|
| 104 | return $this->authorId; |
|
| 105 | } |
|
| 106 | ||
| 107 | public function getAuthorMobile(): string |
|
| 108 | { |
|
| 109 | return $this->authorMobile; |
|
| 110 | } |
|
| 111 | ||
| 112 | public function getAuthorFullName(): string |
|
| 113 | { |
|
| 114 | return $this->authorFullName; |
|
| 115 | } |
|
| 116 | ||
| 117 | public function getAuthorEmail(): string |
|
| 118 | { |
|
| 119 | return $this->authorEmail; |
|
| 120 | } |
|
| 121 | } |
|
| 122 | ||