Conditions | 6 |
Paths | 5 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
46 | 52 | public function jsonSerialize() |
|
47 | { |
||
48 | 52 | $item = []; |
|
49 | 52 | foreach ($this->arguments as $key => $value) { |
|
50 | 52 | if ($value instanceof FilteredCollection && !$value->hasChildren()) { |
|
51 | 2 | continue; |
|
52 | } |
||
53 | |||
54 | 52 | if ($value instanceof JsonSerializable) { |
|
|
|||
55 | 52 | if (!empty($valueSerialized = $value->jsonSerialize())) { |
|
56 | 52 | $item[$key] = $valueSerialized; |
|
57 | } |
||
58 | } else { |
||
59 | 52 | $item[$key] = $value; |
|
60 | } |
||
61 | } |
||
62 | |||
63 | 52 | return $item; |
|
64 | } |
||
65 | } |
||
66 |