Passed
Push — master ( 2aad05...4fe473 )
by Yo
02:45
created

Autoload::getItemId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
ccs 0
cts 6
cp 0
rs 9.4285
cc 1
eloc 5
nc 1
nop 0
crap 2
1
<?php
2
namespace Yoanm\ComposerConfigManager\Domain\Model;
3
4
class Autoload implements ConfigurationItemInterface
5
{
6
    const TYPE_PSR0 = 'psr-0';
7
    const TYPE_PSR4 = 'psr-4';
8
9
    /** @var string */
10
    private $type;
11
    /** @var string */
12
    private $namespace;
13
    /** @var string */
14
    private $path;
15
16
    /**
17
     * @param string $type
18
     * @param string $path
19
     * @param string $namespace
20
     */
21 4
    public function __construct($type, $path, $namespace)
22
    {
23 4
        $this->type = $type;
24 4
        $this->namespace = $namespace;
25 4
        $this->path = $path;
26 4
    }
27
28
    /**
29
     * @return string
30
     */
31 4
    public function getType()
32
    {
33 4
        return $this->type;
34
    }
35
36
    /**
37
     * @return string
38
     */
39 4
    public function getNamespace()
40
    {
41 4
        return $this->namespace;
42
    }
43
44
    /**
45
     * @return string
46
     */
47 4
    public function getPath()
48
    {
49 4
        return $this->path;
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55
    public function getItemId()
56
    {
57
        return sprintf(
58
            '%s#%s',
59
            $this->getType(),
60
            $this->getNamespace()
61
        );
62
    }
63
}
64