Passed
Push — main ( a74a35...8a07cd )
by Fractal
03:04
created

ParametersExtractor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 3
c 2
b 0
f 0
dl 0
loc 11
ccs 3
cts 3
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A extract() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FRZB\Component\RequestMapper\Extractor;
6
7
use FRZB\Component\DependencyInjection\Attribute\AsService;
8
use FRZB\Component\RequestMapper\Mapper\MapperLocatorInterface as MapperLocator;
9
10
#[AsService]
11
class ParametersExtractor
12
{
13 19
    public function __construct(
14
        private readonly MapperLocator $mapperLocator,
15
    ) {
16
    }
17
18 19
    public function extract(string $className, array $parameters): array
19
    {
20 19
        return [...$parameters, ...$this->mapperLocator->get($className, $parameters)($className, $parameters, $parameters)];
21
    }
22
}
23