| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 44 | public function getValue($object) |
||
| 45 | { |
||
| 46 | $get = 'get'.ucfirst($this->property); |
||
| 47 | 4 | $has = 'has'.ucfirst($this->property); |
|
| 48 | $is = 'is'.ucfirst($this->property); |
||
| 49 | 4 | ||
| 50 | 4 | if (method_exists($object, $get)) { |
|
| 51 | 4 | return $object->{$get}(); |
|
| 52 | } |
||
| 53 | 4 | ||
| 54 | 1 | if (method_exists($object, $has)) { |
|
| 55 | return $object->{$has}(); |
||
| 56 | } |
||
| 57 | 3 | ||
| 58 | 1 | if (method_exists($object, $is)) { |
|
| 59 | return $object->{$is}(); |
||
| 60 | } |
||
| 61 | 2 | ||
| 62 | 1 | throw DeserializerLogicException::createMissingMethod(get_class($object), [$get, $has, $is]); |
|
| 63 | } |
||
| 65 |