Skip to content

Commit

Permalink
Fix objects which should be arrayObjects
Browse files Browse the repository at this point in the history
Signed-off-by: Grant Millar <rid@cylo.io>
  • Loading branch information
Rid authored and flavioheleno committed Feb 22, 2023
1 parent eda01f4 commit 520a189
Show file tree
Hide file tree
Showing 95 changed files with 282 additions and 295 deletions.
13 changes: 0 additions & 13 deletions patches/ContainersCreatePostBodyNormalizer.patch

This file was deleted.

6 changes: 3 additions & 3 deletions src/Normalizer/BuildInfoNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function normalize($object, $format = null, array $context = [])
$data['error'] = $object->getError();
}
if ($object->isInitialized('errorDetail') && null !== $object->getErrorDetail()) {
$data['errorDetail'] = $this->normalizer->normalize($object->getErrorDetail(), 'json', $context);
$data['errorDetail'] = new \ArrayObject($this->normalizer->normalize($object->getErrorDetail(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
if ($object->isInitialized('status') && null !== $object->getStatus()) {
$data['status'] = $object->getStatus();
Expand All @@ -128,10 +128,10 @@ public function normalize($object, $format = null, array $context = [])
$data['progress'] = $object->getProgress();
}
if ($object->isInitialized('progressDetail') && null !== $object->getProgressDetail()) {
$data['progressDetail'] = $this->normalizer->normalize($object->getProgressDetail(), 'json', $context);
$data['progressDetail'] = new \ArrayObject($this->normalizer->normalize($object->getProgressDetail(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
if ($object->isInitialized('aux') && null !== $object->getAux()) {
$data['aux'] = $this->normalizer->normalize($object->getAux(), 'json', $context);
$data['aux'] = new \ArrayObject($this->normalizer->normalize($object->getAux(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
foreach ($object as $key => $value) {
if (preg_match('/.*/', (string) $key)) {
Expand Down
6 changes: 3 additions & 3 deletions src/Normalizer/ClusterInfoNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function normalize($object, $format = null, array $context = [])
$data['ID'] = $object->getID();
}
if ($object->isInitialized('version') && null !== $object->getVersion()) {
$data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context);
$data['Version'] = new \ArrayObject($this->normalizer->normalize($object->getVersion(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) {
$data['CreatedAt'] = $object->getCreatedAt();
Expand All @@ -138,10 +138,10 @@ public function normalize($object, $format = null, array $context = [])
$data['UpdatedAt'] = $object->getUpdatedAt();
}
if ($object->isInitialized('spec') && null !== $object->getSpec()) {
$data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context);
$data['Spec'] = new \ArrayObject($this->normalizer->normalize($object->getSpec(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
if ($object->isInitialized('tLSInfo') && null !== $object->getTLSInfo()) {
$data['TLSInfo'] = $this->normalizer->normalize($object->getTLSInfo(), 'json', $context);
$data['TLSInfo'] = new \ArrayObject($this->normalizer->normalize($object->getTLSInfo(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
if ($object->isInitialized('rootRotationInProgress') && null !== $object->getRootRotationInProgress()) {
$data['RootRotationInProgress'] = $object->getRootRotationInProgress();
Expand Down
4 changes: 2 additions & 2 deletions src/Normalizer/ConfigNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function normalize($object, $format = null, array $context = [])
$data['ID'] = $object->getID();
}
if ($object->isInitialized('version') && null !== $object->getVersion()) {
$data['Version'] = $this->normalizer->normalize($object->getVersion(), 'json', $context);
$data['Version'] = new \ArrayObject($this->normalizer->normalize($object->getVersion(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
if ($object->isInitialized('createdAt') && null !== $object->getCreatedAt()) {
$data['CreatedAt'] = $object->getCreatedAt();
Expand All @@ -104,7 +104,7 @@ public function normalize($object, $format = null, array $context = [])
$data['UpdatedAt'] = $object->getUpdatedAt();
}
if ($object->isInitialized('spec') && null !== $object->getSpec()) {
$data['Spec'] = $this->normalizer->normalize($object->getSpec(), 'json', $context);
$data['Spec'] = new \ArrayObject($this->normalizer->normalize($object->getSpec(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
foreach ($object as $key => $value) {
if (preg_match('/.*/', (string) $key)) {
Expand Down
4 changes: 2 additions & 2 deletions src/Normalizer/ConfigSpecNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function normalize($object, $format = null, array $context = [])
$data['Name'] = $object->getName();
}
if ($object->isInitialized('labels') && null !== $object->getLabels()) {
$values = [];
$values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
foreach ($object->getLabels() as $key => $value) {
$values[$key] = $value;
}
Expand All @@ -103,7 +103,7 @@ public function normalize($object, $format = null, array $context = [])
$data['Data'] = $object->getData();
}
if ($object->isInitialized('templating') && null !== $object->getTemplating()) {
$data['Templating'] = $this->normalizer->normalize($object->getTemplating(), 'json', $context);
$data['Templating'] = new \ArrayObject($this->normalizer->normalize($object->getTemplating(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
foreach ($object as $key_1 => $value_1) {
if (preg_match('/.*/', (string) $key_1)) {
Expand Down
4 changes: 2 additions & 2 deletions src/Normalizer/ConfigsCreatePostBodyNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function normalize($object, $format = null, array $context = [])
$data['Name'] = $object->getName();
}
if ($object->isInitialized('labels') && null !== $object->getLabels()) {
$values = [];
$values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
foreach ($object->getLabels() as $key => $value) {
$values[$key] = $value;
}
Expand All @@ -103,7 +103,7 @@ public function normalize($object, $format = null, array $context = [])
$data['Data'] = $object->getData();
}
if ($object->isInitialized('templating') && null !== $object->getTemplating()) {
$data['Templating'] = $this->normalizer->normalize($object->getTemplating(), 'json', $context);
$data['Templating'] = new \ArrayObject($this->normalizer->normalize($object->getTemplating(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
foreach ($object as $key_1 => $value_1) {
if (preg_match('/.*/', (string) $key_1)) {
Expand Down
12 changes: 6 additions & 6 deletions src/Normalizer/ContainerConfigNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ public function normalize($object, $format = null, array $context = [])
$data['AttachStderr'] = $object->getAttachStderr();
}
if ($object->isInitialized('exposedPorts') && null !== $object->getExposedPorts()) {
$values = [];
$values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
foreach ($object->getExposedPorts() as $key => $value) {
$values[$key] = $this->normalizer->normalize($value, 'json', $context);
$values[$key] = new \ArrayObject($this->normalizer->normalize($value, 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
$data['ExposedPorts'] = $values;
}
Expand Down Expand Up @@ -292,7 +292,7 @@ public function normalize($object, $format = null, array $context = [])
$data['Cmd'] = $values_2;
}
if ($object->isInitialized('healthcheck') && null !== $object->getHealthcheck()) {
$data['Healthcheck'] = $this->normalizer->normalize($object->getHealthcheck(), 'json', $context);
$data['Healthcheck'] = new \ArrayObject($this->normalizer->normalize($object->getHealthcheck(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
if ($object->isInitialized('argsEscaped') && null !== $object->getArgsEscaped()) {
$data['ArgsEscaped'] = $object->getArgsEscaped();
Expand All @@ -301,9 +301,9 @@ public function normalize($object, $format = null, array $context = [])
$data['Image'] = $object->getImage();
}
if ($object->isInitialized('volumes') && null !== $object->getVolumes()) {
$values_3 = [];
$values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
foreach ($object->getVolumes() as $key_1 => $value_3) {
$values_3[$key_1] = $this->normalizer->normalize($value_3, 'json', $context);
$values_3[$key_1] = new \ArrayObject($this->normalizer->normalize($value_3, 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
$data['Volumes'] = $values_3;
}
Expand Down Expand Up @@ -331,7 +331,7 @@ public function normalize($object, $format = null, array $context = [])
$data['OnBuild'] = $values_5;
}
if ($object->isInitialized('labels') && null !== $object->getLabels()) {
$values_6 = [];
$values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
foreach ($object->getLabels() as $key_2 => $value_6) {
$values_6[$key_2] = $value_6;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Normalizer/ContainerStateNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function normalize($object, $format = null, array $context = [])
$data['FinishedAt'] = $object->getFinishedAt();
}
if ($object->isInitialized('health') && null !== $object->getHealth()) {
$data['Health'] = $this->normalizer->normalize($object->getHealth(), 'json', $context);
$data['Health'] = new \ArrayObject($this->normalizer->normalize($object->getHealth(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
foreach ($object as $key => $value) {
if (preg_match('/.*/', (string) $key)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ public function normalize($object, $format = null, array $context = [])
{
$data = [];
if ($object->isInitialized('networks') && null !== $object->getNetworks()) {
$values = [];
$values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
foreach ($object->getNetworks() as $key => $value) {
$values[$key] = $this->normalizer->normalize($value, 'json', $context);
$values[$key] = new \ArrayObject($this->normalizer->normalize($value, 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
$data['Networks'] = $values;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Normalizer/ContainerSummaryItemNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function normalize($object, $format = null, array $context = [])
if ($object->isInitialized('ports') && null !== $object->getPorts()) {
$values_1 = [];
foreach ($object->getPorts() as $value_1) {
$values_1[] = $this->normalizer->normalize($value_1, 'json', $context);
$values_1[] = new \ArrayObject($this->normalizer->normalize($value_1, 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
$data['Ports'] = $values_1;
}
Expand All @@ -203,7 +203,7 @@ public function normalize($object, $format = null, array $context = [])
$data['SizeRootFs'] = $object->getSizeRootFs();
}
if ($object->isInitialized('labels') && null !== $object->getLabels()) {
$values_2 = [];
$values_2 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
foreach ($object->getLabels() as $key => $value_2) {
$values_2[$key] = $value_2;
}
Expand All @@ -216,15 +216,15 @@ public function normalize($object, $format = null, array $context = [])
$data['Status'] = $object->getStatus();
}
if ($object->isInitialized('hostConfig') && null !== $object->getHostConfig()) {
$data['HostConfig'] = $this->normalizer->normalize($object->getHostConfig(), 'json', $context);
$data['HostConfig'] = new \ArrayObject($this->normalizer->normalize($object->getHostConfig(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
if ($object->isInitialized('networkSettings') && null !== $object->getNetworkSettings()) {
$data['NetworkSettings'] = $this->normalizer->normalize($object->getNetworkSettings(), 'json', $context);
$data['NetworkSettings'] = new \ArrayObject($this->normalizer->normalize($object->getNetworkSettings(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
if ($object->isInitialized('mounts') && null !== $object->getMounts()) {
$values_3 = [];
foreach ($object->getMounts() as $value_3) {
$values_3[] = $this->normalizer->normalize($value_3, 'json', $context);
$values_3[] = new \ArrayObject($this->normalizer->normalize($value_3, 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
$data['Mounts'] = $values_3;
}
Expand Down
16 changes: 8 additions & 8 deletions src/Normalizer/ContainersCreatePostBodyNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ public function normalize($object, $format = null, array $context = [])
$data['AttachStderr'] = $object->getAttachStderr();
}
if ($object->isInitialized('exposedPorts') && null !== $object->getExposedPorts()) {
$values = [];
$values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
foreach ($object->getExposedPorts() as $key => $value) {
$values[$key] = new \ArrayObject([$this->normalizer->normalize($value, 'json', $context)], \ArrayObject::ARRAY_AS_PROPS);
$values[$key] = new \ArrayObject($this->normalizer->normalize($value, 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
$data['ExposedPorts'] = $values;
}
Expand Down Expand Up @@ -304,7 +304,7 @@ public function normalize($object, $format = null, array $context = [])
$data['Cmd'] = $values_2;
}
if ($object->isInitialized('healthcheck') && null !== $object->getHealthcheck()) {
$data['Healthcheck'] = $this->normalizer->normalize($object->getHealthcheck(), 'json', $context);
$data['Healthcheck'] = new \ArrayObject($this->normalizer->normalize($object->getHealthcheck(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
if ($object->isInitialized('argsEscaped') && null !== $object->getArgsEscaped()) {
$data['ArgsEscaped'] = $object->getArgsEscaped();
Expand All @@ -313,9 +313,9 @@ public function normalize($object, $format = null, array $context = [])
$data['Image'] = $object->getImage();
}
if ($object->isInitialized('volumes') && null !== $object->getVolumes()) {
$values_3 = [];
$values_3 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
foreach ($object->getVolumes() as $key_1 => $value_3) {
$values_3[$key_1] = $this->normalizer->normalize($value_3, 'json', $context);
$values_3[$key_1] = new \ArrayObject($this->normalizer->normalize($value_3, 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
$data['Volumes'] = $values_3;
}
Expand Down Expand Up @@ -343,7 +343,7 @@ public function normalize($object, $format = null, array $context = [])
$data['OnBuild'] = $values_5;
}
if ($object->isInitialized('labels') && null !== $object->getLabels()) {
$values_6 = [];
$values_6 = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
foreach ($object->getLabels() as $key_2 => $value_6) {
$values_6[$key_2] = $value_6;
}
Expand All @@ -363,10 +363,10 @@ public function normalize($object, $format = null, array $context = [])
$data['Shell'] = $values_7;
}
if ($object->isInitialized('hostConfig') && null !== $object->getHostConfig()) {
$data['HostConfig'] = $this->normalizer->normalize($object->getHostConfig(), 'json', $context);
$data['HostConfig'] = new \ArrayObject($this->normalizer->normalize($object->getHostConfig(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
if ($object->isInitialized('networkingConfig') && null !== $object->getNetworkingConfig()) {
$data['NetworkingConfig'] = $this->normalizer->normalize($object->getNetworkingConfig(), 'json', $context);
$data['NetworkingConfig'] = new \ArrayObject($this->normalizer->normalize($object->getNetworkingConfig(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
foreach ($object as $key_3 => $value_8) {
if (preg_match('/.*/', (string) $key_3)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function normalize($object, $format = null, array $context = [])
{
$data = [];
if ($object->isInitialized('errorResponse') && null !== $object->getErrorResponse()) {
$data['ErrorResponse'] = $this->normalizer->normalize($object->getErrorResponse(), 'json', $context);
$data['ErrorResponse'] = new \ArrayObject($this->normalizer->normalize($object->getErrorResponse(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
if ($object->isInitialized('message') && null !== $object->getMessage()) {
$data['message'] = $object->getMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function normalize($object, $format = null, array $context = [])
{
$data = [];
if ($object->isInitialized('errorResponse') && null !== $object->getErrorResponse()) {
$data['ErrorResponse'] = $this->normalizer->normalize($object->getErrorResponse(), 'json', $context);
$data['ErrorResponse'] = new \ArrayObject($this->normalizer->normalize($object->getErrorResponse(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
if ($object->isInitialized('message') && null !== $object->getMessage()) {
$data['message'] = $object->getMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function normalize($object, $format = null, array $context = [])
{
$data = [];
if ($object->isInitialized('errorResponse') && null !== $object->getErrorResponse()) {
$data['ErrorResponse'] = $this->normalizer->normalize($object->getErrorResponse(), 'json', $context);
$data['ErrorResponse'] = new \ArrayObject($this->normalizer->normalize($object->getErrorResponse(), 'json', $context), \ArrayObject::ARRAY_AS_PROPS);
}
if ($object->isInitialized('message') && null !== $object->getMessage()) {
$data['message'] = $object->getMessage();
Expand Down
Loading

0 comments on commit 520a189

Please sign in to comment.