@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | if ($key == 'container') { |
99 | 99 | $this->{$key} = new ContainerEntity($value); |
100 | 100 | } else if ($key == 'fetch') { |
101 | - foreach($value as $fetch) { |
|
101 | + foreach ($value as $fetch) { |
|
102 | 102 | $this->{$key}[] = new FetchEntity($fetch); |
103 | 103 | } |
104 | 104 | } else { |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | unset($return['container']['unknownFields']); |
167 | 167 | |
168 | 168 | $return['container']['volumes'] = []; |
169 | - foreach($this->container->volumes as $volume) { |
|
169 | + foreach ($this->container->volumes as $volume) { |
|
170 | 170 | $fields = (array) $volume + (array) $volume->unknownFields; |
171 | 171 | unset($fields['unknownFields']); |
172 | 172 | $return['container']['volumes'][] = $fields; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | |
176 | 176 | $return['fetch'] = []; |
177 | - foreach($this->fetch as $fetch) { |
|
177 | + foreach ($this->fetch as $fetch) { |
|
178 | 178 | $fields = (array) $fetch + (array) $fetch->unknownFields; |
179 | 179 | unset($fields['unknownFields']); |
180 | 180 | $return['fetch'][] = $fields; |
@@ -97,18 +97,22 @@ discard block |
||
97 | 97 | if (property_exists($this, $key)) { |
98 | 98 | if ($key == 'container') { |
99 | 99 | $this->{$key} = new ContainerEntity($value); |
100 | - } else if ($key == 'fetch') { |
|
100 | + } |
|
101 | + else if ($key == 'fetch') { |
|
101 | 102 | foreach($value as $fetch) { |
102 | 103 | $this->{$key}[] = new FetchEntity($fetch); |
103 | 104 | } |
104 | - } else { |
|
105 | + } |
|
106 | + else { |
|
105 | 107 | $this->{$key} = $value; |
106 | 108 | } |
107 | - } else { |
|
109 | + } |
|
110 | + else { |
|
108 | 111 | $this->unknownFields[$key] = $value; |
109 | 112 | } |
110 | 113 | } |
111 | - } else { |
|
114 | + } |
|
115 | + else { |
|
112 | 116 | throw new \InvalidArgumentException(sprintf('Argument 1 passed to "%s" must be an array or object', __METHOD__)); |
113 | 117 | } |
114 | 118 | } |
@@ -153,14 +157,16 @@ discard block |
||
153 | 157 | $return = (array) $this; |
154 | 158 | if (!empty($this->schedule)) { |
155 | 159 | unset($return['parents']); |
156 | - } else { |
|
160 | + } |
|
161 | + else { |
|
157 | 162 | unset($return['schedule']); |
158 | 163 | unset($return['scheduleTimeZone']); |
159 | 164 | } |
160 | 165 | |
161 | 166 | if (empty($this->container)) { |
162 | 167 | unset($return['container']); |
163 | - } else { |
|
168 | + } |
|
169 | + else { |
|
164 | 170 | $return['container'] = (array) $this->container |
165 | 171 | + (array) $this->container->unknownFields; |
166 | 172 | unset($return['container']['unknownFields']); |
@@ -21,19 +21,23 @@ |
||
21 | 21 | if (property_exists($this, $key)) { |
22 | 22 | if ($key == 'type') { |
23 | 23 | $this->{$key} = strtolower($value); |
24 | - } elseif ($key == 'volumes') { |
|
24 | + } |
|
25 | + elseif ($key == 'volumes') { |
|
25 | 26 | foreach ($value as $valueVolume) { |
26 | 27 | $volume = new ContainerVolumeEntity($valueVolume); |
27 | 28 | $this->volumes[] = $volume; |
28 | 29 | } |
29 | - } else { |
|
30 | + } |
|
31 | + else { |
|
30 | 32 | $this->{$key} = $value; |
31 | 33 | } |
32 | - } else { |
|
34 | + } |
|
35 | + else { |
|
33 | 36 | $this->unknownFields[$key] = $value; |
34 | 37 | } |
35 | 38 | } |
36 | - } else { |
|
39 | + } |
|
40 | + else { |
|
37 | 41 | throw new \InvalidArgumentException(sprintf('Argument 1 passed to "%s" must be an array or object', __METHOD__)); |
38 | 42 | } |
39 | 43 | } |
@@ -20,11 +20,13 @@ |
||
20 | 20 | foreach ($jobData as $key => $value) { |
21 | 21 | if (property_exists($this, $key)) { |
22 | 22 | $this->{$key} = $value; |
23 | - } else { |
|
23 | + } |
|
24 | + else { |
|
24 | 25 | $this->unknownFields[$key] = $value; |
25 | 26 | } |
26 | 27 | } |
27 | - } else { |
|
28 | + } |
|
29 | + else { |
|
28 | 30 | throw new \InvalidArgumentException(sprintf('Argument 1 passed to "%s" must be an array or object', __METHOD__)); |
29 | 31 | } |
30 | 32 | } |
@@ -20,11 +20,13 @@ |
||
20 | 20 | foreach ($jobData as $key => $value) { |
21 | 21 | if (property_exists($this, $key)) { |
22 | 22 | $this->{$key} = $value; |
23 | - } else { |
|
23 | + } |
|
24 | + else { |
|
24 | 25 | $this->unknownFields[$key] = $value; |
25 | 26 | } |
26 | 27 | } |
27 | - } else { |
|
28 | + } |
|
29 | + else { |
|
28 | 30 | throw new \InvalidArgumentException(sprintf('Argument 1 passed to "%s" must be an array or object', __METHOD__)); |
29 | 31 | } |
30 | 32 | } |