We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ab334b9 commit ed12cfeCopy full SHA for ed12cfe
tests/Definitions/Child.php
@@ -5,6 +5,10 @@
5
use Square\Pjson\Json;
6
use Square\Pjson\JsonSerialize;
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
+ */
12
// phpcs:ignore PSR1.Classes.ClassDeclaration
13
class Child
14
{
tests/SerializationTest.php
@@ -290,6 +290,8 @@ public function testCollections()
290
291
public function testMissingParent()
292
293
+ // Ensure that while the `parent` object is null, we can still serialize the parent.id property which is
294
+ // nested under `parent`.
295
$data = new Child();
296
$json = '{"identifier":null,"parent":{"id":null}}';
297
0 commit comments