Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
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
@return
annotation as described here.