@@ -48,7 +48,8 @@ |
||
48 | 48 | |
49 | 49 | if (JobUtils::isWildcard($jobNames)) { |
50 | 50 | $jobIndexService->resetJobIndex(); |
51 | - } else { |
|
51 | + } |
|
52 | + else { |
|
52 | 53 | $jobIndexService->removeJobs($jobNames); |
53 | 54 | } |
54 | 55 | } |
@@ -53,7 +53,8 @@ |
||
53 | 53 | $value = (!empty($value)) |
54 | 54 | ? json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) |
55 | 55 | : $emptyString; |
56 | - } elseif (is_bool($value)) { |
|
56 | + } |
|
57 | + elseif (is_bool($value)) { |
|
57 | 58 | $value = (true === $value) |
58 | 59 | ? 'true' |
59 | 60 | : 'false'; |
@@ -26,7 +26,8 @@ |
||
26 | 26 | MarathonEntityUtils::setAllPossibleProperties((array) $data, $this); |
27 | 27 | if (isset($data['labels'])) { |
28 | 28 | $this->labels = (object) $data['labels']; |
29 | - } else { |
|
29 | + } |
|
30 | + else { |
|
30 | 31 | $this->labels = (object) []; |
31 | 32 | } |
32 | 33 | } |
@@ -114,7 +114,8 @@ discard block |
||
114 | 114 | |
115 | 115 | if (isset($dataArray['upgradeStrategy'])) { |
116 | 116 | $this->upgradeStrategy = new UpgradeStrategy((array) $dataArray['upgradeStrategy']); |
117 | - } else { |
|
117 | + } |
|
118 | + else { |
|
118 | 119 | $this->upgradeStrategy = new UpgradeStrategy(); |
119 | 120 | } |
120 | 121 | |
@@ -129,13 +130,15 @@ discard block |
||
129 | 130 | ksort($env); |
130 | 131 | |
131 | 132 | $this->env = (object) $env; |
132 | - } else { |
|
133 | + } |
|
134 | + else { |
|
133 | 135 | $this->env = (object) []; |
134 | 136 | } |
135 | 137 | |
136 | 138 | if (isset($dataArray['labels'])) { |
137 | 139 | $this->labels = (object) $dataArray['labels']; |
138 | - } else { |
|
140 | + } |
|
141 | + else { |
|
139 | 142 | $this->labels = (object) []; |
140 | 143 | } |
141 | 144 | MarathonEntityUtils::setPropertyIfExist($dataArray, $this, 'constraints'); |
@@ -46,7 +46,8 @@ discard block |
||
46 | 46 | |
47 | 47 | if (!empty($jobName)) { |
48 | 48 | $changed = $this->printJobDiff($jobName); |
49 | - } else { |
|
49 | + } |
|
50 | + else { |
|
50 | 51 | $localJobUpdates = $jobComparisonBusinessCase->getLocalJobUpdates(); |
51 | 52 | if (!empty($localJobUpdates)) { |
52 | 53 | foreach ($localJobUpdates as $jobName) { |
@@ -114,9 +115,11 @@ discard block |
||
114 | 115 | |
115 | 116 | if ($diffSign == '+') { |
116 | 117 | $this->output->writeln(sprintf("<info>%s\t%s: %s</info>", $diffSign, $property, ' ' . substr($diffLine, 1))); |
117 | - } elseif ($diffSign == '-') { |
|
118 | + } |
|
119 | + elseif ($diffSign == '-') { |
|
118 | 120 | $this->output->writeln(sprintf("<fg=red>%s\t%s: %s</>", $diffSign, $property, ' ' . substr($diffLine, 1))); |
119 | - } else { |
|
121 | + } |
|
122 | + else { |
|
120 | 123 | $this->output->writeln(sprintf(" \t%s: %s", $property, $diffLine)); |
121 | 124 | } |
122 | 125 | } |
@@ -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 | } |