Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #16: Patches not applied in latest version. #17

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions patches/NetworkSettingsNormalizer.patch
Original file line number Diff line number Diff line change
@@ -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);
8 changes: 8 additions & 0 deletions src/Normalizer/NetworkSettingsNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down