Completed
Push — master ( daa27a...019907 )
by Vitaly
03:25
created

InjectArgument::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 2
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 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
    /**
20
     * InjectArgument constructor.
21
     *
22
     * @param array $valueOrValues
23
     *
24
     * @throws \InvalidArgumentException
25
     */
26 14
    public function __construct(array $valueOrValues)
27
    {
28
        // Pass to injectable argument configurator
29 14
        parent::__construct(key($valueOrValues), $valueOrValues[key($valueOrValues)]);
30 14
    }
31
}
32