Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 2 | public function getValue($instance) |
|
21 | { |
||
22 | 2 | $property = $this->property; |
|
23 | 2 | $className = get_class($instance); |
|
24 | |||
25 | 2 | if ($className === 'stdClass') { |
|
26 | 1 | return $instance->$property; |
|
27 | } |
||
28 | |||
29 | 1 | return (new \ReflectionProperty($className, $property))->getValue($instance); |
|
30 | } |
||
31 | |||
46 |