| 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 |
||
| 28 | public function getValue($object) |
||
| 29 | { |
||
| 30 | $get = 'get'.ucfirst($this->property); |
||
| 31 | 4 | $has = 'has'.ucfirst($this->property); |
|
| 32 | $is = 'is'.ucfirst($this->property); |
||
| 33 | 4 | ||
| 34 | 4 | if (method_exists($object, $get)) { |
|
| 35 | 4 | return $object->{$get}(); |
|
| 36 | } |
||
| 37 | 4 | ||
| 38 | 1 | if (method_exists($object, $has)) { |
|
| 39 | return $object->{$has}(); |
||
| 40 | } |
||
| 41 | 3 | ||
| 42 | 1 | if (method_exists($object, $is)) { |
|
| 43 | return $object->{$is}(); |
||
| 44 | } |
||
| 45 | 2 | ||
| 46 | 1 | throw SerializerLogicException::createMissingMethod(get_class($object), [$get, $has, $is]); |
|
| 47 | } |
||
| 49 |