Skip to content
This repository has been archived by the owner on Oct 26, 2019. It is now read-only.

Swarm Remote Addrs Needs to be an Array #3

Open
wants to merge 4 commits into
base: 4.1.36
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
10 changes: 5 additions & 5 deletions src/Model/SwarmJoinPostBody.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SwarmJoinPostBody
/**
* Addresses of manager nodes already participating in the swarm.
*
* @var string
* @var array
*/
protected $remoteAddrs;
/**
Expand Down Expand Up @@ -139,21 +139,21 @@ public function setDataPathAddr(?string $dataPathAddr): self
/**
* Addresses of manager nodes already participating in the swarm.
*
* @return string
* @return array
*/
public function getRemoteAddrs(): ?string
public function getRemoteAddrs(): ?array
{
return $this->remoteAddrs;
}

/**
* Addresses of manager nodes already participating in the swarm.
*
* @param string $remoteAddrs
* @param array $remoteAddrs
*
* @return self
*/
public function setRemoteAddrs(?string $remoteAddrs): self
public function setRemoteAddrs(?array $remoteAddrs): self
{
$this->remoteAddrs = $remoteAddrs;

Expand Down
12 changes: 6 additions & 6 deletions src/Model/TaskSpecResources.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TaskSpecResources
*
* @var ResourceObject
*/
protected $reservation;
protected $reservations;

/**
* An object describing the resources which can be advertised by a node and requested by a task.
Expand Down Expand Up @@ -54,21 +54,21 @@ public function setLimits(?ResourceObject $limits): self
*
* @return ResourceObject
*/
public function getReservation(): ?ResourceObject
public function getReservations(): ?ResourceObject
{
return $this->reservation;
return $this->reservations;
}

/**
* An object describing the resources which can be advertised by a node and requested by a task.
*
* @param ResourceObject $reservation
* @param ResourceObject $reservations
*
* @return self
*/
public function setReservation(?ResourceObject $reservation): self
public function setReservations(?ResourceObject $reservations): self
{
$this->reservation = $reservation;
$this->reservations = $reservations;

return $this;
}
Expand Down
8 changes: 4 additions & 4 deletions src/Normalizer/TaskSpecResourcesNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public function denormalize($data, $class, $format = null, array $context = [])
if (property_exists($data, 'Limits') && $data->{'Limits'} !== null) {
$object->setLimits($this->denormalizer->denormalize($data->{'Limits'}, 'Docker\\API\\Model\\ResourceObject', 'json', $context));
}
if (property_exists($data, 'Reservation') && $data->{'Reservation'} !== null) {
$object->setReservation($this->denormalizer->denormalize($data->{'Reservation'}, 'Docker\\API\\Model\\ResourceObject', 'json', $context));
if (property_exists($data, 'Reservations') && $data->{'Reservations'} !== null) {
$object->setReservations($this->denormalizer->denormalize($data->{'Reservations'}, 'Docker\\API\\Model\\ResourceObject', 'json', $context));
}

return $object;
Expand All @@ -54,8 +54,8 @@ public function normalize($object, $format = null, array $context = [])
if (null !== $object->getLimits()) {
$data->{'Limits'} = $this->normalizer->normalize($object->getLimits(), 'json', $context);
}
if (null !== $object->getReservation()) {
$data->{'Reservation'} = $this->normalizer->normalize($object->getReservation(), 'json', $context);
if (null !== $object->getReservations()) {
$data->{'Reservations'} = $this->normalizer->normalize($object->getReservations(), 'json', $context);
}

return $data;
Expand Down