@@ -29,7 +29,7 @@ |
||
29 | 29 | } |
30 | 30 | MarathonEntityUtils::setAllPossibleProperties($oData, $this); |
31 | 31 | |
32 | - if(isset($oData["groups"])) |
|
32 | + if (isset($oData["groups"])) |
|
33 | 33 | { |
34 | 34 | $this->groups = $oData["groups"]; |
35 | 35 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | */ |
28 | 28 | public static function setAllPossibleProperties($oData, $oTarget) |
29 | 29 | { |
30 | - foreach($oData as $attrName => $attrValue) |
|
30 | + foreach ($oData as $attrName => $attrValue) |
|
31 | 31 | { |
32 | 32 | // dont set array or objects. |
33 | 33 | // Because this would need further type information to properly set. |
@@ -44,7 +44,7 @@ |
||
44 | 44 | if (is_array($mData)) |
45 | 45 | { |
46 | 46 | $ret = []; |
47 | - foreach($mData as $data) |
|
47 | + foreach ($mData as $data) |
|
48 | 48 | { |
49 | 49 | $ret[] = new self::$sSubEntityMap[$sName]($data); |
50 | 50 | } |
@@ -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"])) |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | */ |
83 | 83 | public function removeJob($sJobName) |
84 | 84 | { |
85 | - $_oResponse = $this->oHttpClient->delete('/scheduler/job/' . $sJobName); |
|
85 | + $_oResponse = $this->oHttpClient->delete('/scheduler/job/'.$sJobName); |
|
86 | 86 | return ($_oResponse->getStatusCode() == 204); |
87 | 87 | } |
88 | 88 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function getJobStats($sJobName) |
93 | 93 | { |
94 | - return $this->sendGetJsonRequest('/scheduler/job/stat/' . $sJobName); |
|
94 | + return $this->sendGetJsonRequest('/scheduler/job/stat/'.$sJobName); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $_oJobEntityLocal = $this->oJobRepositoryLocal->getJob($sAppId); |
90 | 90 | |
91 | 91 | // check if dependency is satisfied |
92 | - if ( $_oJobEntityLocal->isDependencyJob()) |
|
92 | + if ($_oJobEntityLocal->isDependencyJob()) |
|
93 | 93 | { |
94 | 94 | try { |
95 | 95 | $circular = $this->isDependencyCircular($_oJobEntityLocal, count($_oJobEntityLocal->dependencies)); |
@@ -101,10 +101,10 @@ discard block |
||
101 | 101 | return false; |
102 | 102 | } |
103 | 103 | } |
104 | - catch(\Exception $e) |
|
104 | + catch (\Exception $e) |
|
105 | 105 | { |
106 | 106 | $this->oLogger->error(sprintf( |
107 | - "Job %s cannot be added to remote : %s",$sAppId, $e->getMessage() |
|
107 | + "Job %s cannot be added to remote : %s", $sAppId, $e->getMessage() |
|
108 | 108 | )); |
109 | 109 | return false; |
110 | 110 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | return !(count($arr) == count(array_unique($arr))); |
151 | 151 | } |
152 | 152 | |
153 | - private function isDependencyCircular(JobEntityInterface $oEntity, $immediateChildren, &$path=[]) |
|
153 | + private function isDependencyCircular(JobEntityInterface $oEntity, $immediateChildren, &$path = []) |
|
154 | 154 | { |
155 | 155 | // Invariant: path will not have duplicates for acyclic dependency tree |
156 | 156 | if ($this->hasDuplicates($path)) |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | // for B intermediate Child will be 2. |
197 | 197 | // when we process D, it will be reduced to 1 and with C to 0 |
198 | 198 | // then we will pop B to generate path [A, E] when we reach E. |
199 | - $immediateChildren = $immediateChildren -1; |
|
199 | + $immediateChildren = $immediateChildren - 1; |
|
200 | 200 | if ($immediateChildren == 0) |
201 | 201 | { |
202 | 202 | array_pop($path); |
@@ -85,7 +85,7 @@ |
||
85 | 85 | */ |
86 | 86 | public function getRemoteMissingJobs() |
87 | 87 | { |
88 | - $_ret = $this->getMissingJobsInCollectionA( |
|
88 | + $_ret = $this->getMissingJobsInCollectionA( |
|
89 | 89 | $this->oJobRepositoryChronos->getJobs(), |
90 | 90 | $this->oJobRepositoryLocalChronos->getJobs() |
91 | 91 | ); |
@@ -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; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $_aLocalJobs = $this->oLocalRepository->getJobs(); |
83 | 83 | |
84 | 84 | /** @var JobEntityInterface $_oLocalJob */ |
85 | - foreach($_aLocalJobs as $_oLocalJob) |
|
85 | + foreach ($_aLocalJobs as $_oLocalJob) |
|
86 | 86 | { |
87 | 87 | $_oRemoteJob = $this->oRemoteRepository->getJob($_oLocalJob->getKey()); |
88 | 88 | if (!$_oRemoteJob) |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $_aDifferences[$_sProperty] = $this->oDiffCompare->compare( |
139 | 139 | $_oRemoteJob->{$_sProperty}, |
140 | 140 | $_oLocalJob->{$_sProperty} |
141 | - ) ; |
|
141 | + ); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | return $_aDifferences; |