@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * @var PortDefinition[] |
| 34 | 34 | */ |
| 35 | - public $portDefinitions =[]; |
|
| 35 | + public $portDefinitions = []; |
|
| 36 | 36 | |
| 37 | 37 | public $requirePorts = false; |
| 38 | 38 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | /** |
| 51 | 51 | * @var array |
| 52 | 52 | */ |
| 53 | - public $constraints = []; |
|
| 53 | + public $constraints = []; |
|
| 54 | 54 | |
| 55 | 55 | |
| 56 | 56 | public $acceptedResourceRoles = null; |
@@ -103,44 +103,44 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | if (isset($aData["portDefinitions"])) { |
| 105 | 105 | foreach ($aData["portDefinitions"] as $portDefinition) { |
| 106 | - $this->portDefinitions[] = new DockerPortMapping((array)$portDefinition); |
|
| 106 | + $this->portDefinitions[] = new DockerPortMapping((array) $portDefinition); |
|
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | if (isset($aData["container"])) { |
| 111 | - $this->container = new Container((array)$aData["container"]); |
|
| 111 | + $this->container = new Container((array) $aData["container"]); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | if (isset($aData["fetch"])) |
| 115 | 115 | { |
| 116 | - foreach($aData["fetch"] as $fetch) { |
|
| 117 | - $this->fetch[] = new FetchUrl((array)$fetch); |
|
| 116 | + foreach ($aData["fetch"] as $fetch) { |
|
| 117 | + $this->fetch[] = new FetchUrl((array) $fetch); |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | if (isset($aData["healthChecks"])) |
| 122 | 122 | { |
| 123 | - foreach($aData["healthChecks"] as $healthCheck) |
|
| 123 | + foreach ($aData["healthChecks"] as $healthCheck) |
|
| 124 | 124 | { |
| 125 | - $this->healthChecks[] = new HealthCheck((array)$healthCheck); |
|
| 125 | + $this->healthChecks[] = new HealthCheck((array) $healthCheck); |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | if (isset($aData["upgradeStrategy"])) |
| 130 | 130 | { |
| 131 | - $this->upgradeStrategy = new UpgradeStrategy((array)$aData["upgradeStrategy"]); |
|
| 131 | + $this->upgradeStrategy = new UpgradeStrategy((array) $aData["upgradeStrategy"]); |
|
| 132 | 132 | } else { |
| 133 | 133 | $this->upgradeStrategy = new UpgradeStrategy(); |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | if (isset($aData["ipAddress"])) |
| 137 | 137 | { |
| 138 | - $this->ipAddress = new IpAddress((array)$aData["ipAddress"]); |
|
| 138 | + $this->ipAddress = new IpAddress((array) $aData["ipAddress"]); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | if (isset($aData["env"])) |
| 142 | 142 | { |
| 143 | - $this->env = (object) $aData["env"]; |
|
| 143 | + $this->env = (object) $aData["env"]; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | if (isset($aData["labels"])) |
@@ -38,8 +38,7 @@ discard block |
||
| 38 | 38 | try |
| 39 | 39 | { |
| 40 | 40 | return self::$aIso8601Entity[$_sKey] = new Iso8601Entity($sIso8601); |
| 41 | - } |
|
| 42 | - catch (\InvalidArgumentException $_oException) |
|
| 41 | + } catch (\InvalidArgumentException $_oException) |
|
| 43 | 42 | { |
| 44 | 43 | throw new DatePeriodException(sprintf("Can't init Iso8601Entity for '%s' iso 8601 string.", $sIso8601), 1, $_oException); |
| 45 | 44 | } |
@@ -57,8 +56,7 @@ discard block |
||
| 57 | 56 | if (!empty($sTimeZone)) |
| 58 | 57 | { |
| 59 | 58 | $_oDateStart = new \DateTime(str_replace('Z', '', $_oIso8601Entity->sStartTime), new \DateTimeZone($sTimeZone)); |
| 60 | - } |
|
| 61 | - else |
|
| 59 | + } else |
|
| 62 | 60 | { |
| 63 | 61 | // todo: use a defined chronos time zone here? |
| 64 | 62 | $_oDateStart = new \DateTime($_oIso8601Entity->sStartTime); |
@@ -101,8 +101,7 @@ discard block |
||
| 101 | 101 | if (empty($aJobNames)) |
| 102 | 102 | { |
| 103 | 103 | $_aChronosJobs = $this->oJobRepositoryChronos->getJobs(); |
| 104 | - } |
|
| 105 | - else |
|
| 104 | + } else |
|
| 106 | 105 | { |
| 107 | 106 | $_aChronosJobs = []; |
| 108 | 107 | foreach ($aJobNames as $_sJobName) |
@@ -124,8 +123,7 @@ discard block |
||
| 124 | 123 | 'Job "%s" successfully stored in local repository', |
| 125 | 124 | $_oJobEntity->name |
| 126 | 125 | )); |
| 127 | - } |
|
| 128 | - else |
|
| 126 | + } else |
|
| 129 | 127 | { |
| 130 | 128 | $this->oLogger->error(sprintf( |
| 131 | 129 | 'Failed to store job "%s" in local repository', |
@@ -156,8 +154,7 @@ discard block |
||
| 156 | 154 | 'Job "%s" successfully updated in local repository', |
| 157 | 155 | $_oJobEntity->name |
| 158 | 156 | )); |
| 159 | - } |
|
| 160 | - else |
|
| 157 | + } else |
|
| 161 | 158 | { |
| 162 | 159 | $this->oLogger->error(sprintf( |
| 163 | 160 | 'Failed to update job "%s" in local repository', |
@@ -245,8 +242,7 @@ discard block |
||
| 245 | 242 | if ($this->oJobComparisonBusinessCase->hasSameJobType($_oJobEntityLocal, $_oJobEntityChronos)) |
| 246 | 243 | { |
| 247 | 244 | $_bHasUpdatedJob = $this->oJobRepositoryChronos->updateJob($_oJobEntityLocal); |
| 248 | - } |
|
| 249 | - else |
|
| 245 | + } else |
|
| 250 | 246 | { |
| 251 | 247 | $_bHasUpdatedJob = ( |
| 252 | 248 | $this->oJobRepositoryChronos->removeJob($_oJobEntityChronos->name) |
@@ -34,10 +34,10 @@ discard block |
||
| 34 | 34 | public function getLocalMissingJobs() |
| 35 | 35 | { |
| 36 | 36 | $_aMissingJobs = array(); |
| 37 | - foreach($this->aComposites as $jobComparers) |
|
| 37 | + foreach ($this->aComposites as $jobComparers) |
|
| 38 | 38 | { |
| 39 | 39 | $missing = $jobComparers->getLocalMissingJobs(); |
| 40 | - $_aMissingJobs = array_merge($_aMissingJobs, $missing); |
|
| 40 | + $_aMissingJobs = array_merge($_aMissingJobs, $missing); |
|
| 41 | 41 | } |
| 42 | 42 | return $_aMissingJobs; |
| 43 | 43 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | public function getRemoteMissingJobs() |
| 49 | 49 | { |
| 50 | 50 | $_aChronosMissingJobs = array(); |
| 51 | - foreach($this->aComposites as $jobComparers) |
|
| 51 | + foreach ($this->aComposites as $jobComparers) |
|
| 52 | 52 | { |
| 53 | 53 | $_aChronosMissingJobs = array_merge($_aChronosMissingJobs, $jobComparers->getRemoteMissingJobs()); |
| 54 | 54 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | public function getLocalJobUpdates() |
| 62 | 62 | { |
| 63 | 63 | $_aLocalJobUpdates = array(); |
| 64 | - foreach($this->aComposites as $jobComparers) |
|
| 64 | + foreach ($this->aComposites as $jobComparers) |
|
| 65 | 65 | { |
| 66 | 66 | $_aLocalJobUpdates = array_merge($_aLocalJobUpdates, $jobComparers->getLocalJobUpdates()); |
| 67 | 67 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | public function getJobDiff($sJobName) |
| 76 | 76 | { |
| 77 | 77 | $_aJobDiffs = array(); |
| 78 | - foreach($this->aComposites as $jobComparers) |
|
| 78 | + foreach ($this->aComposites as $jobComparers) |
|
| 79 | 79 | { |
| 80 | 80 | // NOTE: only gets the first one. |
| 81 | 81 | // does it make sense? |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | /** @var JobComparisonInterface $comparer */ |
| 101 | 101 | $comparer = null; |
| 102 | - foreach($this->aComposites as $child) |
|
| 102 | + foreach ($this->aComposites as $child) |
|
| 103 | 103 | { |
| 104 | 104 | if ($child->isJobAvailable($oJobEntityA->getKey())) |
| 105 | 105 | { |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function isJobAvailable($sJobName) |
| 125 | 125 | { |
| 126 | - foreach($this->aComposites as $child) { |
|
| 126 | + foreach ($this->aComposites as $child) { |
|
| 127 | 127 | if ($child->isJobAvailable($sJobName)) |
| 128 | 128 | { |
| 129 | 129 | return true; |
@@ -99,10 +99,12 @@ |
||
| 99 | 99 | { |
| 100 | 100 | if ($this->oRepositoryBridge->addJob($oJobEntity)) |
| 101 | 101 | { |
| 102 | - if (!is_null($this->oJobCollection)) // if no collection inited the new job will init by chronos request |
|
| 102 | + if (!is_null($this->oJobCollection)) { |
|
| 103 | + // if no collection inited the new job will init by chronos request |
|
| 103 | 104 | { |
| 104 | 105 | $this->oJobCollection->offsetSet($oJobEntity->getKey(), $oJobEntity); |
| 105 | 106 | } |
| 107 | + } |
|
| 106 | 108 | |
| 107 | 109 | return true; |
| 108 | 110 | } |
@@ -55,8 +55,7 @@ |
||
| 55 | 55 | $_mValue = (!empty($_mValue)) |
| 56 | 56 | ? json_encode($_mValue, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) |
| 57 | 57 | : $_sEmptyString; |
| 58 | - } |
|
| 59 | - elseif (is_bool($_mValue)) |
|
| 58 | + } elseif (is_bool($_mValue)) |
|
| 60 | 59 | { |
| 61 | 60 | $_mValue = (true === $_mValue) |
| 62 | 61 | ? 'true' |