| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | private function linkAnnotation(array $body, array $methodAnnotations, Hal $hal) : Hal |
||
| 40 | { |
||
| 41 | foreach ($methodAnnotations as $annotation) { |
||
| 42 | if (! $annotation instanceof Link) { |
||
| 43 | continue; |
||
| 44 | } |
||
| 45 | $uri = uri_template($annotation->href, $body); |
||
| 46 | $reverseUri = $this->getReverseLink($uri); |
||
| 47 | if (isset($body['_links'][$annotation->rel])) { |
||
| 48 | // skip if already difined links in ResourceObject |
||
| 49 | continue; |
||
| 50 | } |
||
| 51 | $hal->addLink($annotation->rel, $reverseUri); |
||
| 52 | } |
||
| 53 | |||
| 54 | return $hal; |
||
| 55 | } |
||
| 56 | |||
| 68 |