Failed Conditions
Pull Request — master (#1)
by Jonathan
13:20 queued 01:26
created

StaticReflectionService::getClassNamespace()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 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
    public function getParentClasses($class)
15
    {
16
        return [];
17
    }
18
19
    /**
20
     * {@inheritDoc}
21
     */
22
    public function getClassShortName($className)
23
    {
24
        if (strpos($className, '\\') !== false) {
25
            $className = substr($className, strrpos($className, "\\") + 1);
26
        }
27
        return $className;
28
    }
29
30
    /**
31
     * {@inheritDoc}
32
     */
33
    public function getClassNamespace($className)
34
    {
35
        $namespace = '';
36
        if (strpos($className, '\\') !== false) {
37
            $namespace = strrev(substr(strrev($className), strpos(strrev($className), '\\') + 1));
38
        }
39
        return $namespace;
40
    }
41
42
    /**
43
     * {@inheritDoc}
44
     */
45
    public function getClass($class)
46
    {
47
        return null;
48
    }
49
50
    /**
51
     * {@inheritDoc}
52
     */
53
    public function getAccessibleProperty($class, $property)
54
    {
55
        return null;
56
    }
57
58
    /**
59
     * {@inheritDoc}
60
     */
61
    public function hasPublicMethod($class, $method)
62
    {
63
        return true;
64
    }
65
}
66