Failed Conditions
Push — master ( 07d765...457451 )
by Jonathan
39s
created

StaticReflectionService   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 8
dl 0
loc 55
ccs 17
cts 17
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getParentClasses() 0 3 1
A getClassShortName() 0 6 2
A getClassNamespace() 0 7 2
A hasPublicMethod() 0 3 1
A getAccessibleProperty() 0 3 1
A getClass() 0 3 1
1
<?php
2
namespace Doctrine\Common\Persistence\Mapping;
3
4
/**
5
 * PHP Runtime Reflection Service.
6
 *
7
 * @author Benjamin Eberlei <[email protected]>
8
 */
9
class StaticReflectionService implements ReflectionService
10
{
11
    /**
12
     * {@inheritDoc}
13
     */
14 1
    public function getParentClasses($class)
15
    {
16 1
        return [];
17
    }
18
19
    /**
20
     * {@inheritDoc}
21
     */
22 1
    public function getClassShortName($className)
23
    {
24 1
        if (strpos($className, '\\') !== false) {
25 1
            $className = substr($className, strrpos($className, "\\") + 1);
26
        }
27 1
        return $className;
28
    }
29
30
    /**
31
     * {@inheritDoc}
32
     */
33 1
    public function getClassNamespace($className)
34
    {
35 1
        $namespace = '';
36 1
        if (strpos($className, '\\') !== false) {
37 1
            $namespace = strrev(substr(strrev($className), strpos(strrev($className), '\\') + 1));
38
        }
39 1
        return $namespace;
40
    }
41
42
    /**
43
     * {@inheritDoc}
44
     */
45 1
    public function getClass($class)
46
    {
47 1
        return null;
48
    }
49
50
    /**
51
     * {@inheritDoc}
52
     */
53 1
    public function getAccessibleProperty($class, $property)
54
    {
55 1
        return null;
56
    }
57
58
    /**
59
     * {@inheritDoc}
60
     */
61 1
    public function hasPublicMethod($class, $method)
62
    {
63 1
        return true;
64
    }
65
}
66