ArrayTargetResolver   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 24
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A resolve() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Darkilliant\ImportBundle\TargetResolver;
6
7
/**
8
 * @internal
9
 */
10
class ArrayTargetResolver
11
{
12
    /** @var DoctrineTargetResolver */
13
    private $resolver;
14
15 1
    public function __construct(DoctrineTargetResolver $resolver)
16
    {
17 1
        $this->resolver = $resolver;
18 1
    }
19
20
    /**
21
     * @param array $data
22
     *
23
     * @throws \Exception
24
     *
25
     * @return array
26
     */
27 1
    public function resolve(array $data, array $config)
28
    {
29 1
        foreach ($config as $propertyName => $propertyConfig) {
30 1
            $data[$propertyName] = $this->resolver->resolve($propertyConfig);
31
        }
32
33 1
        return $data;
34
    }
35
}
36