This repository was archived by the owner on Oct 26, 2019. It is now read-only.

Description
Hi,
when calling Client::containerInspect on container that does not have mapped all ports, I get Invalid argument supplied for foreach() exception in Normalizer/NetworkSettingsNormalizer.php:60.
The $value variable may be null in case the port is not mapped
if (property_exists($data, 'Ports') && $data->{'Ports'} !== null) {
$values = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);
foreach ($data->{'Ports'} as $key => $value) {
$values_1 = [];
foreach ($value as $value_1) {
$values_1[] = $this->denormalizer->denormalize($value_1, 'Docker\\API\\Model\\PortBinding', 'json', $context);
}
$values[$key] = $values_1;
}
$object->setPorts($values);
}
Fragment of docker inspect command:
"8302/udp": null,
"8500/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "32792"
}
],