Test Failed
Push — main ( 450f80...a11e57 )
by Fractal
02:32
created

DefaultPropertyMapper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A map() 0 3 1
A canMap() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FRZB\Component\RequestMapper\PropertyMapper\Mapper;
6
7
use FRZB\Component\DependencyInjection\Attribute\AsService;
8
use FRZB\Component\DependencyInjection\Attribute\AsTagged;
9
use FRZB\Component\RequestMapper\Helper\PropertyHelper;
10
11
#[AsService, AsTagged(PropertyMapperInterface::class, priority: 0)]
12
final class DefaultPropertyMapper implements PropertyMapperInterface
13
{
14
    public function map(\ReflectionProperty $property, mixed $value): array
15
    {
16
        return [PropertyHelper::getName($property) => []];
17
    }
18
19
    public function canMap(\ReflectionProperty $property): bool
20
    {
21
        return true;
22
    }
23
}
24