Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function getValue($object) |
||
28 | { |
||
29 | $class = $this->getClass($object); |
||
30 | 3 | ||
31 | if (!property_exists($class, $this->property)) { |
||
32 | 3 | throw SerializerLogicException::createMissingProperty($class, $this->property); |
|
33 | } |
||
34 | 3 | ||
35 | 1 | $getter = \Closure::bind( |
|
36 | function ($property) { |
||
37 | return $this->{$property}; |
||
38 | 2 | }, |
|
39 | 2 | $object, |
|
40 | 2 | $class |
|
41 | 2 | ); |
|
42 | 2 | ||
43 | 2 | return $getter($this->property); |
|
44 | } |
||
65 |