StaticReflectionService::getParentClasses()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Persistence\Mapping;
6
7
use function strpos;
8
use function strrev;
9
use function strrpos;
10
use function substr;
11
12
/**
13
 * PHP Runtime Reflection Service.
14
 */
15
class StaticReflectionService implements ReflectionService
16
{
17
    /**
18
     * {@inheritDoc}
19
     */
20 1
    public function getParentClasses(string $class)
21
    {
22 1
        return [];
23
    }
24
25
    /**
26
     * {@inheritDoc}
27
     */
28 1
    public function getClassShortName(string $className)
29
    {
30 1
        if (strpos($className, '\\') !== false) {
31
            /** @var int $pos */
32 1
            $pos = strrpos($className, '\\');
33
34 1
            $className = substr($className, $pos + 1);
35
        }
36
37 1
        return $className;
38
    }
39
40
    /**
41
     * {@inheritDoc}
42
     */
43 1
    public function getClassNamespace(string $className)
44
    {
45 1
        $namespace = '';
46
47 1
        if (strpos($className, '\\') !== false) {
48
            /** @var int $pos */
49 1
            $pos = strpos(strrev($className), '\\');
50
51 1
            $namespace = strrev(substr(strrev($className), $pos + 1));
52
        }
53
54 1
        return $namespace;
55
    }
56
57
    /**
58
     * {@inheritDoc}
59
     */
60 1
    public function getClass(string $class)
61
    {
62 1
        return null;
63
    }
64
65
    /**
66
     * {@inheritDoc}
67
     */
68 1
    public function getAccessibleProperty(string $class, string $property)
69
    {
70 1
        return null;
71
    }
72
73
    /**
74
     * {@inheritDoc}
75
     */
76 1
    public function hasPublicMethod(string $class, string $method)
77
    {
78 1
        return true;
79
    }
80
}
81