| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 40 | public function normalize($object, $format = null, array $context = array()) |
|
| 19 | { |
||
| 20 | 40 | if (!$object instanceof Verb) { |
|
| 21 | return; |
||
| 22 | } |
||
| 23 | |||
| 24 | $data = array( |
||
| 25 | 40 | 'id' => $object->getId()->getValue(), |
|
|
|
|||
| 26 | ); |
||
| 27 | |||
| 28 | 40 | if (null !== $display = $object->getDisplay()) { |
|
| 29 | 38 | $data['display'] = $this->normalizeAttribute($display, $format, $context); |
|
| 30 | } |
||
| 31 | |||
| 32 | 40 | return $data; |
|
| 33 | } |
||
| 34 | |||
| 66 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.