Completed
Push — master ( 036719...7e3b96 )
by Vitaly
03:14
created

CollectionParameterResolver::resolve()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 2
1
<?php declare(strict_types = 1);
2
/**
3
 * Created by PhpStorm.
4
 * User: root
5
 * Date: 29.07.2016
6
 * Time: 21:38.
7
 */
8
namespace samsonframework\containercollection;
9
10
use samsonframework\container\configurator\ParameterConfiguratorInterface;
11
use samsonframework\container\metadata\ParameterMetadata;
12
13
/**
14
 * Collection parameter resolver class.
15
 *
16
 * @author Vitaly Iegorov <[email protected]>
17
 */
18
class CollectionParameterResolver extends AbstractCollectionResolver implements CollectionParameterResolverInterface
19
{
20
    /** Collection parameter key */
21
    const KEY = 'arguments';
22
23
    /**
24
     * {@inheritDoc}
25
     */
26
    public function resolve(array $parameterDataArray, ParameterMetadata $parameterMetadata)
27
    {
28
        // Iterate collection
29
        foreach ($this->getAttributeConfigurator($parameterDataArray) as $configurator) {
30
            /** @var ParameterConfiguratorInterface $configurator Parse parameter metadata */
31
            $configurator->toParameterMetadata($parameterMetadata);
32
        }
33
34
        return $parameterMetadata;
35
    }
36
}
37