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

AbstractConfigurationReader   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A introspectClass() 0 14 2
configure() 0 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