Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
CRAP | |
100.00% |
1 / 1 |
| UserDto | |
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
|
100.00% |
4 / 4 |
4 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getCreatedAt | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getAvatar | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\User\Infrastructure\Dto; |
| 4 | |
| 5 | use App\Shared\Domain\Model\StoredFile; |
| 6 | use App\Shared\Infrastructure\Dto\StoredFileDto; |
| 7 | use App\Shared\Infrastructure\Service\StoredFileDtoTransformer; |
| 8 | use App\User\Domain\Model\User; |
| 9 | use Symfony\Component\ObjectMapper\Attribute\Map; |
| 10 | |
| 11 | #[Map(source: User::class)] |
| 12 | final class UserDto |
| 13 | { |
| 14 | public function __construct( |
| 15 | public string $id, |
| 16 | public \DateTimeImmutable $createdAt, |
| 17 | // #[Map(if: false) |
| 18 | #[Map(source: 'avatar', transform: StoredFileDtoTransformer::class)] |
| 19 | public ?StoredFileDto $avatar = null |
| 20 | ) { |
| 21 | } |
| 22 | |
| 23 | public function getId(): string |
| 24 | { |
| 25 | return $this->id; |
| 26 | } |
| 27 | |
| 28 | public function getCreatedAt(): \DateTimeImmutable |
| 29 | { |
| 30 | return $this->createdAt; |
| 31 | } |
| 32 | |
| 33 | public function getAvatar(): ?StoredFileDto |
| 34 | { |
| 35 | return $this->avatar; |
| 36 | } |
| 37 | } |