Test Failed
Push — master ( a380eb...a52ae2 )
by Hannes
01:59
created

ExampleName::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace hanneskod\readmetester\Name;
6
7
final class ExampleName implements NameInterface
8
{
9
    /** @var string */
10
    private $shortName;
11
12
    /** @var string */
13
    private $namespace;
14
15
    public function __construct(string $shortName, string $namespace)
16
    {
17
        $this->shortName = $shortName;
18
        $this->namespace = $namespace;
19
    }
20
21
    public function getCompleteName(): string
22
    {
23
        return $this->getNamespaceName() . self::NAME_DELIMITER . $this->getShortName();
24
    }
25
26
    public function getShortName(): string
27
    {
28
        return $this->shortName;
29
    }
30
31
    public function getNamespaceName(): string
32
    {
33
        return $this->namespace;
34
    }
35
36
    public function equals(NameInterface $name): bool
37
    {
38
        return $name->getCompleteName() == $this->getCompleteName();
39
    }
40
}
41