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

InjectArgument::checkArgumentExists()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

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