Skip to content

Commit eda01f4

Browse files
Ridflavioheleno
authored andcommitted
Move patch to the correct loop
Signed-off-by: Grant Millar <rid@cylo.io>
1 parent d72a49d commit eda01f4

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

patches/NetworkSettingsNormalizer.patch

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
diff --git a/src/Normalizer/NetworkSettingsNormalizer.php b/src/Normalizer/NetworkSettingsNormalizer.php
2-
index dc48cc5..2e492d2 100644
2+
index dc48cc5..a3cb884 100644
33
--- a/src/Normalizer/NetworkSettingsNormalizer.php
44
+++ b/src/Normalizer/NetworkSettingsNormalizer.php
5-
@@ -81,6 +81,10 @@ class NetworkSettingsNormalizer implements DenormalizerInterface, NormalizerInte
5+
@@ -79,6 +79,10 @@ class NetworkSettingsNormalizer implements DenormalizerInterface, NormalizerInte
6+
if (\array_key_exists('Ports', $data) && $data['Ports'] !== null) {
7+
$values = new \ArrayObject(array(), \ArrayObject::ARRAY_AS_PROPS);
68
foreach ($data['Ports'] as $key => $value) {
9+
+ if ($value === null) {
10+
+ $values[$key] = null;
11+
+ continue;
12+
+ }
713
$values_1 = array();
814
foreach ($value as $value_1) {
9-
+ if ($value === null) {
10-
+ $values[$key] = null;
11-
+ continue;
12-
+ }
1315
$values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PortBinding', 'json', $context);
14-
}
15-
$values[$key] = $values_1;
1616
@@ -218,6 +222,10 @@ class NetworkSettingsNormalizer implements DenormalizerInterface, NormalizerInte
1717
if ($object->isInitialized('ports') && null !== $object->getPorts()) {
1818
$values = array();

src/Normalizer/NetworkSettingsNormalizer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ public function denormalize($data, $class, $format = null, array $context = [])
7979
if (\array_key_exists('Ports', $data) && null !== $data['Ports']) {
8080
$values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
8181
foreach ($data['Ports'] as $key => $value) {
82+
if (null === $value) {
83+
$values[$key] = null;
84+
continue;
85+
}
8286
$values_1 = [];
8387
foreach ($value as $value_1) {
84-
if (null === $value) {
85-
$values[$key] = null;
86-
continue;
87-
}
8888
$values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PortBinding', 'json', $context);
8989
}
9090
$values[$key] = $values_1;

0 commit comments

Comments
 (0)