Failed Conditions
Push — master ( 148895...b07393 )
by Guilherme
09:59
created

StaticReflectionService   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
dl 0
loc 58
ccs 0
cts 17
cp 0
rs 10
c 1
b 0
f 0
wmc 8

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getParentClasses() 0 3 1
A getClassNamespace() 0 9 2
A getAccessibleProperty() 0 3 1
A hasPublicMethod() 0 3 1
A getClassShortName() 0 7 2
A getClass() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\ORM\Reflection;
6
7
use ReflectionClass;
8
use ReflectionProperty;
9
use function strpos;
10
use function strrev;
11
use function strrpos;
12
use function substr;
13
14
/**
15
 * PHP Runtime Reflection Service.
16
 */
17
class StaticReflectionService implements ReflectionService
18
{
19
    /**
20
     * {@inheritDoc}
21
     */
22
    public function getParentClasses(string $className) : array
23
    {
24
        return [];
25
    }
26
27
    /**
28
     * {@inheritDoc}
29
     */
30
    public function getClassShortName(string $className) : string
31
    {
32
        if (strpos($className, '\\') !== false) {
33
            $className = substr($className, strrpos($className, '\\')+1);
34
        }
35
36
        return $className;
37
    }
38
39
    /**
40
     * {@inheritDoc}
41
     */
42
    public function getClassNamespace(string $className) : string
43
    {
44
        $namespace = '';
45
46
        if (strpos($className, '\\') !== false) {
47
            $namespace = strrev(substr(strrev($className), strpos(strrev($className), '\\')+1));
48
        }
49
50
        return $namespace;
51
    }
52
53
    /**
54
     * {@inheritDoc}
55
     */
56
    public function getClass(string $className) : ?ReflectionClass
57
    {
58
        return null;
59
    }
60
61
    /**
62
     * {@inheritDoc}
63
     */
64
    public function getAccessibleProperty(string $className, string $propertyName) : ?ReflectionProperty
65
    {
66
        return null;
67
    }
68
69
    /**
70
     * {@inheritDoc}
71
     */
72
    public function hasPublicMethod(string $className, string $methodName) : bool
73
    {
74
        return true;
75
    }
76
}
77