Completed
Push — master ( 1dae95...9a26bc )
by Vitaly
15:48 queued 08:40
created

Name::toClassMetadata()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 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\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 1
    public function __construct(string $name)
34
    {
35 1
        $this->name = $name;
36 1
    }
37
38
    /**
39
     * {@inheritDoc}
40
     */
41 1
    public function toClassMetadata(ClassMetadata $classMetadata)
42
    {
43 1
        $classMetadata->name = $this->name;
44 1
    }
45
}
46