Completed
Push — master ( 7e3b96...cb9969 )
by Vitaly
03:03
created

Name::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
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\metadata\ClassMetadata;
12
13
/**
14
 * Name attribute configurator class.
15
 *
16
 * @see    \samsonframework\container\configurator\ScopeConfigurator
17
 *
18
 * @author Vitaly Egorov <[email protected]>
19
 */
20
class Name implements ClassConfiguratorInterface, AttributeConfiguratorInterface
21
{
22
    /** @var string Configurator key */
23
    const KEY = 'name';
24
25
    /** @var string Dependency name */
26
    protected $name;
27
28
    /**
29
     * Dependency name collection configurator constructor.
30
     *
31
     * @param string $name Dependency name
32
     */
33
    public function __construct(string $name)
34
    {
35
        $this->name = $name;
36
    }
37
38
    /**
39
     * {@inheritDoc}
40
     */
41
    public function toClassMetadata(ClassMetadata $classMetadata)
42
    {
43
        $classMetadata->name = $this->name;
44
    }
45
}
46