Completed
Push — master ( 3bccd6...c364ad )
by Vitaly
03:16
created

Value::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 0
loc 4
rs 10
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\containercollection\attribute;
9
10
use samsonframework\container\configurator\ClassConfiguratorInterface;
11
use samsonframework\container\configurator\ParameterConfiguratorInterface;
12
use samsonframework\container\configurator\PropertyConfiguratorInterface;
13
use samsonframework\container\metadata\ClassMetadata;
14
use samsonframework\container\metadata\ParameterMetadata;
15
use samsonframework\container\metadata\PropertyMetadata;
16
17
/**
18
 * Property/parameter value attribute configurator class.
19
 *
20
 * @author Vitaly Egorov <[email protected]>
21
 *
22
 */
23
class Value implements PropertyConfiguratorInterface, ParameterConfiguratorInterface, AttributeConfiguratorInterface
24
{
25
    /** @var string Configurator key */
26
    const KEY = 'value';
27
28
    /**
29
     * @var string Property/Parameter value
30
     */
31
    protected $value;
32
33
    /**
34
     * Class collection configurator constructor.
35
     *
36
     * @param string $className Class name
0 ignored issues
show
Bug introduced by
There is no parameter named $className. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
37
     */
38
    public function __construct(string $value)
39
    {
40
        $this->value = $value;
41
    }
42
43
    /* {@inheritDoc} */
44
    public function toPropertyMetadata(PropertyMetadata $propertyMetadata)
45
    {
46
        $propertyMetadata->dependency = $this->value;
47
    }
48
49
    /* {@inheritDoc} */
50
    public function toParameterMetadata(ParameterMetadata $parameterMetadata)
51
    {
52
        $parameterMetadata->dependency = $this->value;
53
    }
54
}
55