Code Coverage |
||||||||||||||||
Lines |
Branches |
Paths |
Functions and Methods |
Classes and Traits |
||||||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
5 / 5 |
|
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| StoredFileDtoTransformer | |
100.00% |
2 / 2 |
|
100.00% |
5 / 5 |
|
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| __invoke | |
100.00% |
1 / 1 |
|
100.00% |
4 / 4 |
|
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace App\Shared\Infrastructure\Service; |
| 4 | |
| 5 | use App\Shared\Domain\Model\StoredFile; |
| 6 | use App\Shared\Infrastructure\Dto\StoredFileDto; |
| 7 | use Symfony\Component\ObjectMapper\ObjectMapperInterface; |
| 8 | use Symfony\Component\ObjectMapper\TransformCallableInterface; |
| 9 | |
| 10 | /** |
| 11 | * @author Wilhelm Zwertvaegher |
| 12 | * @implements TransformCallableInterface<StoredFile, StoredFileDto> |
| 13 | */ |
| 14 | readonly class StoredFileDtoTransformer implements TransformCallableInterface |
| 15 | { |
| 16 | |
| 17 | public function __construct( |
| 18 | private ObjectMapperInterface $objectMapper |
| 19 | |
| 20 | ) { |
| 21 | } |
| 22 | |
| 23 | public function __invoke(mixed $value, object $source, ?object $target): mixed |
| 24 | { |
| 25 | return null === $value ? null : $this->objectMapper->map($value, StoredFileDto::class); |
| 26 | } |
| 27 | } |
Below are the source code lines that represent each code path as identified by Xdebug. Please note a path is not
necessarily coterminous with a line, a line may contain multiple paths and therefore show up more than once.
Please also be aware that some paths may include implicit rather than explicit branches, e.g. an if statement
always has an else as part of its logical flow even if you didn't write one.
| 17 | public function __construct( |
| 18 | private ObjectMapperInterface $objectMapper |
| 19 | |
| 20 | ) { |
| 21 | } |
| 23 | public function __invoke(mixed $value, object $source, ?object $target): mixed |
| 24 | { |
| 25 | return null === $value ? null : $this->objectMapper->map($value, StoredFileDto::class); |
| 25 | return null === $value ? null : $this->objectMapper->map($value, StoredFileDto::class); |
| 25 | return null === $value ? null : $this->objectMapper->map($value, StoredFileDto::class); |
| 26 | } |
| 23 | public function __invoke(mixed $value, object $source, ?object $target): mixed |
| 24 | { |
| 25 | return null === $value ? null : $this->objectMapper->map($value, StoredFileDto::class); |
| 25 | return null === $value ? null : $this->objectMapper->map($value, StoredFileDto::class); |
| 25 | return null === $value ? null : $this->objectMapper->map($value, StoredFileDto::class); |
| 26 | } |
| 3 | namespace App\Shared\Infrastructure\Service; |
| 4 | |
| 5 | use App\Shared\Domain\Model\StoredFile; |
| 6 | use App\Shared\Infrastructure\Dto\StoredFileDto; |
| 7 | use Symfony\Component\ObjectMapper\ObjectMapperInterface; |
| 8 | use Symfony\Component\ObjectMapper\TransformCallableInterface; |
| 9 | |
| 10 | /** |
| 11 | * @author Wilhelm Zwertvaegher |
| 12 | * @implements TransformCallableInterface<StoredFile, StoredFileDto> |
| 13 | */ |
| 14 | readonly class StoredFileDtoTransformer implements TransformCallableInterface |
| 15 | { |
| 16 | |
| 17 | public function __construct( |
| 18 | private ObjectMapperInterface $objectMapper |
| 19 | |
| 20 | ) { |
| 21 | } |
| 22 | |
| 23 | public function __invoke(mixed $value, object $source, ?object $target): mixed |
| 24 | { |
| 25 | return null === $value ? null : $this->objectMapper->map($value, StoredFileDto::class); |
| 26 | } |