ArrayTargetResolver::resolve()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 2
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 2
rs 10
c 0
b 0
f 0
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