diff --git a/patches/NetworkSettingsNormalizer.patch b/patches/NetworkSettingsNormalizer.patch index 509cd29f..81821033 100644 --- a/patches/NetworkSettingsNormalizer.patch +++ b/patches/NetworkSettingsNormalizer.patch @@ -1,26 +1,26 @@ diff --git a/src/Normalizer/NetworkSettingsNormalizer.php b/src/Normalizer/NetworkSettingsNormalizer.php -index dc48cc5..a3cb884 100644 +index 0c73d7f..a3c893a 100644 --- a/src/Normalizer/NetworkSettingsNormalizer.php +++ b/src/Normalizer/NetworkSettingsNormalizer.php -@@ -79,6 +79,10 @@ class NetworkSettingsNormalizer implements DenormalizerInterface, NormalizerInte - if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) { - $values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS); - foreach ($data['Ports'] as $key => $value) { -+ if ($value === null) { -+ $values[$key] = null; -+ continue; -+ } - $values_1 = array(); - foreach ($value as $value_1) { - $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PortBinding', 'json', $context); -@@ -218,6 +222,10 @@ class NetworkSettingsNormalizer implements DenormalizerInterface, NormalizerInte - if ($object->isInitialized('ports') && null !== $object->getPorts()) { - $values = array(); - foreach ($object->getPorts() as $key => $value) { -+ if ($value === null) { -+ $values[$key] = null; -+ continue; -+ } - $values_1 = array(); - foreach ($value as $value_1) { - $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); +@@ -78,6 +78,10 @@ if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR + if (\array_key_exists('Ports', $data) && null !== $data['Ports']) { + $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); + foreach ($data['Ports'] as $key => $value) { ++ if ($value === null) { ++ $values[$key] = null; ++ continue; ++ } + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PortBinding', 'json', $context); +@@ -203,6 +207,10 @@ if (!class_exists(Kernel::class) || (Kernel::MAJOR_VERSION >= 7 || Kernel::MAJOR + if ($object->isInitialized('ports') && null !== $object->getPorts()) { + $values = []; + foreach ($object->getPorts() as $key => $value) { ++ if ($value === null) { ++ $values[$key] = null; ++ continue; ++ } + $values_1 = []; + foreach ($value as $value_1) { + $values_1[] = $this->normalizer->normalize($value_1, 'json', $context); diff --git a/src/Normalizer/NetworkSettingsNormalizer.php b/src/Normalizer/NetworkSettingsNormalizer.php index 0c73d7f3..a3c893a0 100644 --- a/src/Normalizer/NetworkSettingsNormalizer.php +++ b/src/Normalizer/NetworkSettingsNormalizer.php @@ -78,6 +78,10 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a if (\array_key_exists('Ports', $data) && null !== $data['Ports']) { $values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS); foreach ($data['Ports'] as $key => $value) { + if ($value === null) { + $values[$key] = null; + continue; + } $values_1 = []; foreach ($value as $value_1) { $values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PortBinding', 'json', $context); @@ -203,6 +207,10 @@ public function normalize(mixed $object, ?string $format = null, array $context if ($object->isInitialized('ports') && null !== $object->getPorts()) { $values = []; foreach ($object->getPorts() as $key => $value) { + if ($value === null) { + $values[$key] = null; + continue; + } $values_1 = []; foreach ($value as $value_1) { $values_1[] = $this->normalizer->normalize($value_1, 'json', $context);