Completed
Pull Request — master (#150)
by Kevin
03:12
created

AbstractConfigurationReader::introspectClass()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 9
nc 2
nop 1
1
<?php
2
3
namespace Magium\Util\Configuration;
4
5
abstract class AbstractConfigurationReader
6
{
7
8
    protected function introspectClass(ConfigurableObjectInterface $object)
9
    {
10
        $reflectionClass = new \ReflectionClass($object);
11
        $classes = [
12
            $reflectionClass->getName()
0 ignored issues
show
Bug introduced by
Consider using $reflectionClass->name. There is an issue with getName() and APC-enabled PHP versions.
Loading history...
13
        ];
14
        while (($class = $reflectionClass->getParentClass()) !== false) {
15
            $classes[] = $class->getName();
16
            $reflectionClass = $class;
17
        }
18
19
        $classes = array_reverse($classes);
20
        return $classes;
21
    }
22
23
    abstract public function configure(ConfigurableObjectInterface $object);
24
25
}
26