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