Value   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 1 Features 1
Metric Value
wmc 3
c 1
b 1
f 1
lcom 1
cbo 2
dl 0
loc 32
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A toPropertyMetadata() 0 4 1
A toParameterMetadata() 0 4 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