Completed
Push — master ( 5ac91e...39483e )
by Kirill
38:30
created

BaseValue::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file is part of Railt package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace Railt\SDL\Base\Definitions\Enum;
11
12
use Railt\SDL\Base\Dependent\BaseDependent;
13
use Railt\SDL\Base\Invocations\Directive\BaseDirectivesContainer;
14
use Railt\SDL\Contracts\Definitions\Enum\ValueDefinition;
15
use Railt\SDL\Contracts\Type;
16
17
/**
18
 * Class BaseValue
19
 */
20
abstract class BaseValue extends BaseDependent implements ValueDefinition
21
{
22
    use BaseDirectivesContainer;
23
24
    /**
25
     * Enum value type name
26
     */
27
    protected const TYPE_NAME = Type::ENUM_VALUE;
28
29
    /**
30
     * @return string
31
     */
32 5425
    public function getValue(): string
33
    {
34 5425
        return (string)$this->name;
35
    }
36
37
    /**
38
     * @return string
39
     */
40 5425
    public function getName(): string
41
    {
42 5425
        return $this->getValue();
43
    }
44
45
    /**
46
     * @return array
47
     */
48 1004
    public function __sleep(): array
49
    {
50 1004
        return \array_merge(parent::__sleep(), [
51
52 1004
        ]);
53
    }
54
}
55