From e62b888d30b641acee8c1651afca9358b0b2ff45 Mon Sep 17 00:00:00 2001 From: Henrik Thesing Date: Tue, 12 Feb 2019 10:53:29 +0100 Subject: [PATCH] Fix result of code example Fix result of last code example $serializer->serialize(['c' => 'd'], SerializationContext::create()->setInitialType('array')); should lead to the output // {"c" : "d"} --- doc/cookbook/arrays.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cookbook/arrays.rst b/doc/cookbook/arrays.rst index 5529d60e0..87c29aae5 100644 --- a/doc/cookbook/arrays.rst +++ b/doc/cookbook/arrays.rst @@ -39,7 +39,7 @@ In case of a JSON serialization: $serializer->serialize([], SerializationContext::create()->setInitialType('array')); // {} $serializer->serialize([1, 2], SerializationContext::create()->setInitialType('array')); // {"0" : 1, "1" : 2} $serializer->serialize(['a', 'b'], SerializationContext::create()->setInitialType('array')); // {"0" : "a", "1" : "b"} - $serializer->serialize(['c' => 'd'], SerializationContext::create()->setInitialType('array')); // {"d" : "d"} + $serializer->serialize(['c' => 'd'], SerializationContext::create()->setInitialType('array')); // {"c" : "d"} .. note ::