Completed
Push — master ( 84de63...78afc8 )
by Valentin
02:36
created

ReflectionDeclaration::getShortName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Cycle\ORM\Promise\Declaration\Declaration;
5
6
use Cycle\ORM\Promise\Declaration\DeclarationInterface;
7
8
final class ReflectionDeclaration implements DeclarationInterface
9
{
10
    /** @var \ReflectionClass */
11
    private $reflection;
12
13
    public function __construct(\ReflectionClass $class)
14
    {
15
        $this->reflection = $class;
16
    }
17
18
    public function getShortName(): string
19
    {
20
        return $this->reflection->getShortName();
21
    }
22
23
    public function getNamespaceName(): ?string
24
    {
25
        return $this->reflection->inNamespace() ? $this->reflection->getNamespaceName() : null;
26
    }
27
28
    public function getFullName(): string
29
    {
30
        return $this->reflection->name;
31
    }
32
}