| Total Complexity | 2 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | final class Assembler |
||
| 11 | { |
||
| 12 | public function toBookDto(Book $book): BookDto |
||
| 13 | { |
||
| 14 | $dto = new BookDto(); |
||
| 15 | |||
| 16 | $dto->id = (string) $book->id(); |
||
| 17 | $dto->authorId = (string) $book->authorId(); |
||
| 18 | $dto->title = $book->title(); |
||
| 19 | $dto->createdAt = $book->createdAt(); |
||
| 20 | |||
| 21 | return $dto; |
||
| 22 | } |
||
| 23 | |||
| 24 | public function toAuthorDto(Author $author): AuthorDto |
||
| 25 | { |
||
| 26 | $dto = new AuthorDto(); |
||
| 27 | |||
| 28 | $dto->id = (string) $author->id(); |
||
| 29 | $dto->fullName = $author->fullName(); |
||
| 30 | $dto->booksCount = $author->booksCount(); |
||
| 31 | |||
| 32 | return $dto; |
||
| 33 | } |
||
| 35 |