Completed
Push — master ( 8f61de...6beb52 )
by Vitaly
02:52
created

ClassName   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 1
cbo 3
dl 0
loc 40
ccs 12
cts 12
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A toClassMetadata() 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\container\collection;
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
 * Class collection configurator class.
19
 *
20
 * @see    \samsonframework\container\configurator\ScopeConfigurator
21
 *
22
 * @author Vitaly Egorov <[email protected]>
23
 *
24
 */
25
class ClassName implements ClassConfiguratorInterface, PropertyConfiguratorInterface, ParameterConfiguratorInterface, CollectionAttributeConfiguratorInterface
26
{
27
    /**
28
     * @var string Configurator key
29
     */
30
    const CONFIGURATOR_KEY = 'class';
31
32
    /**
33
     * @var string Dependency class name
34
     */
35
    protected $className;
36
37
    /**
38
     * Class collection configurator constructor.
39
     *
40
     * @param string $className Class name
41
     */
42 1
    public function __construct(string $className)
43
    {
44 1
        $this->className = $className;
45 1
    }
46
47
    /* {@inheritDoc} */
48 1
    public function toClassMetadata(ClassMetadata $classMetadata)
49
    {
50 1
        $classMetadata->className = $this->className;
51 1
    }
52
53
    /* {@inheritDoc} */
54 1
    public function toPropertyMetadata(PropertyMetadata $propertyMetadata)
55
    {
56 1
        $propertyMetadata->dependency = $this->className;
57 1
    }
58
59
    /* {@inheritDoc} */
60 1
    public function toParameterMetadata(ParameterMetadata $parameterMetadata)
61
    {
62 1
        $parameterMetadata->dependency = $this->className;
63 1
    }
64
}
65