| Conditions | 4 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4.0218 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | 4 | protected function cutMetadata($raw) |
|
| 25 | { |
||
| 26 | 4 | if (!is_array($raw)) { |
|
| 27 | return [[]]; |
||
| 28 | } |
||
| 29 | |||
| 30 | 4 | if (array_key_exists('_links', $raw)) { |
|
| 31 | 1 | foreach ($raw['_links'] as $k => $v) { |
|
| 32 | 1 | $raw['links'][] = [ |
|
| 33 | 1 | 'rel' => $k, |
|
| 34 | 1 | 'href' => current($v), |
|
| 35 | ]; |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | 4 | return $this->dataPiece('links', $raw); |
|
| 40 | } |
||
| 41 | |||
| 61 |