| Conditions | 4 |
| Paths | 8 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4.5923 |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 65 | 6 | $this->data = $data; |
|
| 66 | 6 | } |
|
| 67 | |||
| 68 | 3 | public function jsonSerialize() |
|
| 69 | { |
||
| 70 | 3 | $relationship = []; |
|
| 71 | |||
| 72 | 3 | if ($this->data) { |
|
| 73 | 3 | $relationship['data'] = is_array($this->data) |
|
| 74 | 3 | ? array_map([$this, 'buildIdentifier'], $this->data) |
|
| 75 | 3 | : $this->buildIdentifier($this->data); |
|
| 76 | 3 | } |
|
| 77 | |||
| 78 | 3 | return array_filter($relationship + [ |
|
| 79 | 3 | 'meta' => $this->meta, |
|
| 80 | 3 | 'links' => $this->links |
|
| 81 | 3 | ]); |
|
| 82 | } |
||
| 83 | |||
| 92 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@returnannotation as described here.