| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function hydrate(AnnotationInterface $annotation, array $json, ResourceInterface $object): array |
||
| 14 | { |
||
| 15 | if (!($annotation instanceof Rename)) { |
||
| 16 | return $json; |
||
| 17 | } |
||
| 18 | |||
| 19 | foreach ($annotation->properties() as $property) { |
||
| 20 | if (!isset($json[$annotation->get($property)])) { |
||
| 21 | continue; |
||
| 22 | } |
||
| 23 | |||
| 24 | $json[$property] = $json[$annotation->get($property)]; |
||
| 25 | unset($json[$annotation->get($property)]); |
||
| 26 | } |
||
| 27 | |||
| 28 | return $json; |
||
| 29 | } |
||
| 30 | |||
| 45 |