ArrayTargetResolver::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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