Completed
Push — master ( 70601c...836386 )
by Vitaly
04:46
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 1
Metric Value
c 1
b 0
f 1
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;
9
10
use samsonframework\container\configurator\ClassConfiguratorInterface;
11
use samsonframework\container\metadata\ClassMetadata;
12
13
/**
14
 * Scope collection configurator class.
15
 *
16
 * @see    \samsonframework\container\configurator\ScopeConfigurator
17
 *
18
 * @author Vitaly Egorov <[email protected]>
19
 */
20
class Name implements ClassConfiguratorInterface, CollectionAttributeConfiguratorInterface
21
{
22
    /** @var string Dependency name */
23
    protected $name;
24
25
    /**
26
     * Dependency name collection configurator constructor.
27
     *
28
     * @param string $name Dependency name
29
     */
30 1
    public function __construct(string $name)
31
    {
32 1
        $this->name = $name;
33 1
    }
34
35
    /**
36
     * {@inheritDoc}
37
     */
38 1
    public function toClassMetadata(ClassMetadata $classMetadata)
39
    {
40 1
        $classMetadata->name = $this->name;
41 1
    }
42
}
43