Issues (31)

ClassMapper/ClassMapper.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FRZB\Component\RequestMapper\ClassMapper;
6
7
use Fp\Collections\ArrayList;
8
use FRZB\Component\DependencyInjection\Attribute\AsService;
9
use FRZB\Component\RequestMapper\PropertyMapper\PropertyMapperLocatorInterface as PropertyMapperLocator;
10
11
#[AsService]
12
final class ClassMapper implements ClassMapperInterface
13
{
14
    public function __construct(
15
        private readonly PropertyMapperLocator $mapperLocator,
16
    ) {
17
    }
18
19
    public function map(string $className, mixed $value): array
20
    {
21
        try {
22
            return ArrayList::collect((new \ReflectionClass($className))->getProperties())
23
                ->map(fn (\ReflectionProperty $property) => $this->mapperLocator->get($property)->map($property, $value) ?? [])
24
                ->reduce(array_merge(...))
0 ignored issues
show
The type FRZB\Component\RequestMa...ClassMapper\array_merge was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
25
                ->getOrElse([])
26
            ;
27
        } catch (\ReflectionException) {
28
            return [];
29
        }
30
    }
31
}
32