Code Coverage
 
Lines
Branches
Paths
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
80.00% covered (warning)
80.00%
4 / 5
66.67% covered (warning)
66.67%
2 / 3
50.00% covered (danger)
50.00%
1 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
StoredFileUrlTransformer
100.00% covered (success)
100.00%
2 / 2
80.00% covered (warning)
80.00%
4 / 5
66.67% covered (warning)
66.67%
2 / 3
100.00% covered (success)
100.00%
2 / 2
3.33
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 __invoke
100.00% covered (success)
100.00%
1 / 1
75.00% covered (warning)
75.00%
3 / 4
50.00% covered (danger)
50.00%
1 / 2
100.00% covered (success)
100.00%
1 / 1
2.50
1<?php
2
3namespace App\Shared\Infrastructure\Service;
4
5use App\Shared\Domain\Model\StoredFile;
6use App\Shared\Infrastructure\Dto\StoredFileDto;
7use App\Shared\Infrastructure\Persistence\Doctrine\Entity\DoctrineStoredFile;
8use Doctrine\ORM\Internal\StronglyConnectedComponents;
9use Symfony\Component\ObjectMapper\ObjectMapper;
10use Symfony\Component\ObjectMapper\ObjectMapperInterface;
11use Symfony\Component\ObjectMapper\TransformCallableInterface;
12
13/**
14 * @author Wilhelm Zwertvaegher
15 * @implements  TransformCallableInterface<StoredFile, StoredFileDto>
16 */
17readonly class StoredFileUrlTransformer implements TransformCallableInterface
18{
19
20    public function __construct(
21        private FileStorageProvider $fileStorageProvider
22    ) {
23    }
24
25    public function __invoke(mixed $value, object $source, ?object $target): mixed
26    {
27        return null === $value ? null : $this->fileStorageProvider->generateUrl($source);
28    }
29}

Paths

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.

StoredFileUrlTransformer->__construct
20    public function __construct(
21        private FileStorageProvider $fileStorageProvider
22    ) {
23    }
StoredFileUrlTransformer->__invoke
25    public function __invoke(mixed $value, object $source, ?object $target): mixed
26    {
27        return null === $value ? null : $this->fileStorageProvider->generateUrl($source);
 
27        return null === $value ? null : $this->fileStorageProvider->generateUrl($source);
 
27        return null === $value ? null : $this->fileStorageProvider->generateUrl($source);
28    }
25    public function __invoke(mixed $value, object $source, ?object $target): mixed
26    {
27        return null === $value ? null : $this->fileStorageProvider->generateUrl($source);
 
27        return null === $value ? null : $this->fileStorageProvider->generateUrl($source);
 
27        return null === $value ? null : $this->fileStorageProvider->generateUrl($source);
28    }
{main}
3namespace App\Shared\Infrastructure\Service;
4
5use App\Shared\Domain\Model\StoredFile;
6use App\Shared\Infrastructure\Dto\StoredFileDto;
7use App\Shared\Infrastructure\Persistence\Doctrine\Entity\DoctrineStoredFile;
8use Doctrine\ORM\Internal\StronglyConnectedComponents;
9use Symfony\Component\ObjectMapper\ObjectMapper;
10use Symfony\Component\ObjectMapper\ObjectMapperInterface;
11use Symfony\Component\ObjectMapper\TransformCallableInterface;
12
13/**
14 * @author Wilhelm Zwertvaegher
15 * @implements  TransformCallableInterface<StoredFile, StoredFileDto>
16 */
17readonly class StoredFileUrlTransformer implements TransformCallableInterface
18{
19
20    public function __construct(
21        private FileStorageProvider $fileStorageProvider
22    ) {
23    }
24
25    public function __invoke(mixed $value, object $source, ?object $target): mixed
26    {
27        return null === $value ? null : $this->fileStorageProvider->generateUrl($source);
28    }