File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 5
5
use Square \Pjson \Json ;
6
6
use Square \Pjson \JsonSerialize ;
7
7
8
+ /**
9
+ * Keep properties in this exact order in this class. We want to confirm valid serialization when serializing `parent`
10
+ * set that value to `null` but something further down needs to set a nested property there.
11
+ */
8
12
// phpcs:ignore PSR1.Classes.ClassDeclaration
9
13
class Child
10
14
{
Original file line number Diff line number Diff line change @@ -290,6 +290,8 @@ public function testCollections()
290
290
291
291
public function testMissingParent ()
292
292
{
293
+ // Ensure that while the `parent` object is null, we can still serialize the parent.id property which is
294
+ // nested under `parent`.
293
295
$ data = new Child ();
294
296
$ json = '{"identifier":null,"parent":{"id":null}} ' ;
295
297
You can’t perform that action at this time.
0 commit comments