@@ -259,9 +259,9 @@ public function normalize($object, $format = null, array $context = [])
259259 $ data ['AttachStderr ' ] = $ object ->getAttachStderr ();
260260 }
261261 if ($ object ->isInitialized ('exposedPorts ' ) && null !== $ object ->getExposedPorts ()) {
262- $ values = [] ;
262+ $ values = new \ ArrayObject ([], \ArrayObject:: ARRAY_AS_PROPS ) ;
263263 foreach ($ object ->getExposedPorts () as $ key => $ value ) {
264- $ values [$ key ] = $ this ->normalizer ->normalize ($ value , 'json ' , $ context );
264+ $ values [$ key ] = null === $ value ? null : new \ ArrayObject ( $ this ->normalizer ->normalize ($ value , 'json ' , $ context), \ArrayObject:: ARRAY_AS_PROPS );
265265 }
266266 $ data ['ExposedPorts ' ] = $ values ;
267267 }
@@ -289,7 +289,7 @@ public function normalize($object, $format = null, array $context = [])
289289 $ data ['Cmd ' ] = $ values_2 ;
290290 }
291291 if ($ object ->isInitialized ('healthcheck ' ) && null !== $ object ->getHealthcheck ()) {
292- $ data ['Healthcheck ' ] = $ this ->normalizer ->normalize ($ object ->getHealthcheck (), 'json ' , $ context );
292+ $ data ['Healthcheck ' ] = null === $ object -> getHealthcheck () ? null : new \ ArrayObject ( $ this ->normalizer ->normalize ($ object ->getHealthcheck (), 'json ' , $ context), \ArrayObject:: ARRAY_AS_PROPS );
293293 }
294294 if ($ object ->isInitialized ('argsEscaped ' ) && null !== $ object ->getArgsEscaped ()) {
295295 $ data ['ArgsEscaped ' ] = $ object ->getArgsEscaped ();
@@ -298,9 +298,9 @@ public function normalize($object, $format = null, array $context = [])
298298 $ data ['Image ' ] = $ object ->getImage ();
299299 }
300300 if ($ object ->isInitialized ('volumes ' ) && null !== $ object ->getVolumes ()) {
301- $ values_3 = [] ;
301+ $ values_3 = new \ ArrayObject ([], \ArrayObject:: ARRAY_AS_PROPS ) ;
302302 foreach ($ object ->getVolumes () as $ key_1 => $ value_3 ) {
303- $ values_3 [$ key_1 ] = $ this ->normalizer ->normalize ($ value_3 , 'json ' , $ context );
303+ $ values_3 [$ key_1 ] = null === $ value_3 ? null : new \ ArrayObject ( $ this ->normalizer ->normalize ($ value_3 , 'json ' , $ context), \ArrayObject:: ARRAY_AS_PROPS );
304304 }
305305 $ data ['Volumes ' ] = $ values_3 ;
306306 }
@@ -328,7 +328,7 @@ public function normalize($object, $format = null, array $context = [])
328328 $ data ['OnBuild ' ] = $ values_5 ;
329329 }
330330 if ($ object ->isInitialized ('labels ' ) && null !== $ object ->getLabels ()) {
331- $ values_6 = [] ;
331+ $ values_6 = new \ ArrayObject ([], \ArrayObject:: ARRAY_AS_PROPS ) ;
332332 foreach ($ object ->getLabels () as $ key_2 => $ value_6 ) {
333333 $ values_6 [$ key_2 ] = $ value_6 ;
334334 }
0 commit comments