Completed
Push — master ( 7e3d04...dc7866 )
by Changwan
06:39
created

CannotChangeException::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Wandu\DI\Exception;
3
4
use Psr\Container\ContainerExceptionInterface;
5
use RuntimeException;
6
7
class CannotChangeException extends RuntimeException implements ContainerExceptionInterface
8
{
9
    /** @var string */
10
    protected $name;
11
12
    /**
13
     * @param string $name
14
     */
15 2
    public function __construct($name)
16
    {
17 2
        $this->name = $name;
18 2
        $this->message = "it cannot be changed; \"{$name}\".";
19 2
    }
20
21
    /**
22
     * @return string
23
     */
24
    public function getName()
25
    {
26
        return $this->name;
27
    }
28
}
29