@@ -237,10 +237,12 @@ discard block |
||
| 237 | 237 | if ($mod == 0) { |
| 238 | 238 | if ($printTime) { |
| 239 | 239 | $timeline .= $this->parseTimeLineStrMark($printJobStart, $printJobEnd, $hasToCloseFinalTag, $time->format('H>i'), $time->format('H:i')); |
| 240 | - } else { |
|
| 240 | + } |
|
| 241 | + else { |
|
| 241 | 242 | $timeline .= $this->parseTimeLineStrMark($printJobStart, $printJobEnd, $hasToCloseFinalTag, str_repeat('>', 5), str_repeat($spacer, 5)); |
| 242 | 243 | } |
| 243 | - } else { |
|
| 244 | + } |
|
| 245 | + else { |
|
| 244 | 246 | $timeline .= $this->parseTimeLineStrMark($printJobStart, $printJobEnd, $hasToCloseFinalTag, '>', $spacer); |
| 245 | 247 | } |
| 246 | 248 | } |
@@ -265,13 +267,16 @@ discard block |
||
| 265 | 267 | { |
| 266 | 268 | if ($printJobStart && $printJobEnd) { |
| 267 | 269 | $timelineSnippet = sprintf('<comment>%s</comment>', $startStopMark); |
| 268 | - } elseif ($printJobStart) { |
|
| 270 | + } |
|
| 271 | + elseif ($printJobStart) { |
|
| 269 | 272 | $timelineSnippet = sprintf('<comment>%s', $startStopMark); |
| 270 | 273 | $bHasToCloseFinalTag = true; |
| 271 | - } elseif ($printJobEnd) { |
|
| 274 | + } |
|
| 275 | + elseif ($printJobEnd) { |
|
| 272 | 276 | $timelineSnippet = sprintf('%s</comment>', $startStopMark); |
| 273 | 277 | $bHasToCloseFinalTag = false; |
| 274 | - } else { |
|
| 278 | + } |
|
| 279 | + else { |
|
| 275 | 280 | $timelineSnippet = $spacer; |
| 276 | 281 | } |
| 277 | 282 | |
@@ -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'; |
@@ -22,7 +22,8 @@ |
||
| 22 | 22 | $this->{$key} = $value; |
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | - } else { |
|
| 25 | + } |
|
| 26 | + else { |
|
| 26 | 27 | throw new \InvalidArgumentException(sprintf('Argument 1 passed to "%s" must be an array or object', __METHOD__)); |
| 27 | 28 | } |
| 28 | 29 | } |
@@ -21,17 +21,20 @@ |
||
| 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 | 34 | } |
| 33 | 35 | } |
| 34 | - } else { |
|
| 36 | + } |
|
| 37 | + else { |
|
| 35 | 38 | throw new \InvalidArgumentException(sprintf('Argument 1 passed to "%s" must be an array or object', __METHOD__)); |
| 36 | 39 | } |
| 37 | 40 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | public function jsonSerialize() |
| 38 | 38 | { |
| 39 | 39 | $return = (array) $this; |
| 40 | - $return = array_filter($return, function ($value, $key) { |
|
| 40 | + $return = array_filter($return, function($value, $key) { |
|
| 41 | 41 | return !is_null($value); |
| 42 | 42 | }, ARRAY_FILTER_USE_BOTH); |
| 43 | 43 | return $return; |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | /** @var JobComparisonInterface $jobComparisonBusinessCase */ |
| 58 | 58 | $jobComparisonBusinessCase = $this->getContainer()->get(JobComparisonInterface::DIC_NAME); |
| 59 | 59 | |
| 60 | - $jobs = [ $jobName ]; |
|
| 60 | + $jobs = [$jobName]; |
|
| 61 | 61 | |
| 62 | 62 | if (strpos($jobName, '*') !== false) { |
| 63 | 63 | $jobs = $this->getJobsMatchingWildcard($jobName); |
@@ -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 | } |
@@ -22,7 +22,8 @@ |
||
| 22 | 22 | $this->{$key} = $value; |
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | - } else { |
|
| 25 | + } |
|
| 26 | + else { |
|
| 26 | 27 | throw new \InvalidArgumentException(sprintf('Argument 1 passed to "%s" must be an array or object', __METHOD__)); |
| 27 | 28 | } |
| 28 | 29 | } |
@@ -95,20 +95,24 @@ discard block |
||
| 95 | 95 | if (property_exists($this, $key)) { |
| 96 | 96 | if ($key == 'container') { |
| 97 | 97 | $this->{$key} = new ContainerEntity($value); |
| 98 | - } else if ($key == 'fetch') { |
|
| 98 | + } |
|
| 99 | + else if ($key == 'fetch') { |
|
| 99 | 100 | foreach ($value as $fetch) { |
| 100 | 101 | $this->{$key}[] = new FetchEntity($fetch); |
| 101 | 102 | } |
| 102 | - } else { |
|
| 103 | + } |
|
| 104 | + else { |
|
| 103 | 105 | $this->{$key} = $value; |
| 104 | 106 | } |
| 105 | - } else { |
|
| 107 | + } |
|
| 108 | + else { |
|
| 106 | 109 | /* We are ignoring fields that are unknown to us. This is bad and can lead to unexpected differences |
| 107 | 110 | * when comparing the *.json on disk with the job definition from the Chronos API. |
| 108 | 111 | */ |
| 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 | |
| 166 | 172 | $return['container']['volumes'] = []; |