Skip to content

Commit 46677f9

Browse files
committed
Make sure included is always a plain array so it is serialized as array
1 parent 90ec46d commit 46677f9

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010

1111
* Omit item from included when it has no attributes or relationships (only type and id)
1212
N.B. This is a breaking change if you implement the `ItemInterface` yourself instead of using the supplied `Item`.
13+
* Make sure included is always a plain array so it is serialized as array
1314

1415
## [0.12.1] - 2019-01-11
1516

src/Item.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,13 @@ function (ItemInterface $item) use (&$included) {
221221
}
222222
}
223223

224-
return $included->unique(
225-
function (array $item) {
226-
return $item['type'].':'.$item['id'];
227-
}
228-
);
224+
return $included
225+
->unique(
226+
function (array $item) {
227+
return $item['type'].':'.$item['id'];
228+
}
229+
)
230+
->values();
229231
}
230232

231233
/**

0 commit comments

Comments
 (0)