Completed
Push — master ( 5d4923...821e5b )
by Vitaly
03:07
created

Service::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 2
nc 1
nop 1
1
<?php declare(strict_types = 1);
2
/**
3
 * Created by PhpStorm.
4
 * User: root
5
 * Date: 27.07.2016
6
 * Time: 1:55.
7
 */
8
namespace samsonframework\container\collection;
9
10
use samsonframework\container\configurator\ScopeConfigurator;
11
12
/**
13
 * Service collection configurator class.
14
 * @see    \samsonframework\container\configurator\ServiceConfigurator
15
 *
16
 * @author Vitaly Egorov <[email protected]>
17
 */
18
class Service extends ScopeConfigurator implements CollectionKeyConfiguratorInterface
19
{
20
    /**
21
     * Service collection configurator constructor.
22
     *
23
     * @param string|array $valueOrValues Service unique name
24
     *
25
     * @throws \InvalidArgumentException
26
     */
27
    public function __construct($valueOrValues)
28
    {
29
        // Pass to scope configurator
30
        parent::__construct($valueOrValues);
0 ignored issues
show
Bug introduced by
It seems like $valueOrValues defined by parameter $valueOrValues on line 27 can also be of type array; however, samsonframework\containe...igurator::__construct() does only seem to accept string, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
31
    }
32
}
33