Completed
Push — master ( 692093...daa27a )
by Vitaly
02:57
created

InjectArgument   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 50%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 20
ccs 2
cts 4
cp 0.5
rs 10
c 2
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
1
<?php declare(strict_types = 1);
2
/**
3
 * Created by Vitaly Iegorov <[email protected]>.
4
 * on 07.08.16 at 15:46
5
 */
6
namespace samsonframework\container\annotation;
7
8
use samsonframework\container\configurator\InjectableArgumentConfigurator;
9
10
/**
11
 * Method argument injection annotation.
12
 *
13
 * @author Vitaly Egorov <[email protected]>
14
 *
15
 * @Annotation
16
 */
17
class InjectArgument extends InjectableArgumentConfigurator
18
{
19
    use AnnotationValueTrait;
20
21
    /**
22
     * InjectArgument constructor.
23
     *
24
     * @param array $valueOrValues
25
     *
26
     * @throws \InvalidArgumentException
27
     */
28 13
    public function __construct(array $valueOrValues)
29
    {
30
        // Parse argument injection data
31 13
        list($argumentName, $argumentType) = each($this->parseAnnotationValue($valueOrValues));
0 ignored issues
show
Bug introduced by
$this->parseAnnotationValue($valueOrValues) cannot be passed to each() as the parameter $array expects a reference.
Loading history...
32
33
        // Pass to injectable argument configurator
34
        parent::__construct($argumentName, $argumentType);
35
    }
36
}
37