| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function normalize($object, $format = null, array $context = []): array |
||
| 33 | { |
||
| 34 | $data = [ |
||
| 35 | 'href' => $object->getHref()->getPath(), |
||
| 36 | ]; |
||
| 37 | |||
| 38 | if ($object->getHref()->isTemplated()) { |
||
| 39 | $data['templated'] = true; |
||
| 40 | } |
||
| 41 | |||
| 42 | if (\count($object->getAttributes())) { |
||
| 43 | $data['attributes'] = $object->getAttributes(); |
||
| 44 | } |
||
| 45 | |||
| 46 | return $data; |
||
| 47 | } |
||
| 57 |