ReflectionDeclaration::getFullName()   A
last analyzed

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
3
/**
4
 * Spiral Framework. Cycle ProxyFactory
5
 *
6
 * @license MIT
7
 * @author  Valentin V (Vvval)
8
 */
9
10
declare(strict_types=1);
11
12
namespace Cycle\ORM\Promise\Declaration\Declaration;
13
14
use Cycle\ORM\Promise\Declaration\DeclarationInterface;
15
use ReflectionClass;
16
17
final class ReflectionDeclaration implements DeclarationInterface
18
{
19
    /** @var ReflectionClass */
20
    private $reflection;
21
22
    /**
23
     * @param ReflectionClass $class
24
     */
25
    public function __construct(ReflectionClass $class)
26
    {
27
        $this->reflection = $class;
28
    }
29
30
    /**
31
     * @return string
32
     */
33
    public function getShortName(): string
34
    {
35
        return $this->reflection->getShortName();
36
    }
37
38
    /**
39
     * @return string|null
40
     */
41
    public function getNamespaceName(): ?string
42
    {
43
        return $this->reflection->inNamespace() ? $this->reflection->getNamespaceName() : null;
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function getFullName(): string
50
    {
51
        return $this->reflection->name;
52
    }
53
}
54