GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Branch feature/add_marathon_support (b15d53)
by Marc
16:34
created
src/Service/JobValidator/PropertyValidator/Epsilon.php 2 patches
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -57,9 +57,11 @@  discard block
 block discarded – undo
57 57
                 $_oDateIntervalEpsilon = new \DateInterval($oJobEntity->epsilon);
58 58
                 $_iIntervalEpsilon = (int) $_oDateIntervalEpsilon->format('%Y%M%D%H%I%S');
59 59
 
60
-                if ($_iIntervalEpsilon > 30) // if epsilon > "PT30S"
60
+                if ($_iIntervalEpsilon > 30) {
61
+                    // if epsilon > "PT30S"
61 62
                 {
62 63
                     $_oIso8601Entity = $this->oDatePeriodFactory->createIso8601Entity($oJobEntity->schedule);
64
+                }
63 65
 
64 66
                     $_oDateIntervalScheduling = new \DateInterval($_oIso8601Entity->sInterval);
65 67
                     $_iIntervalScheduling = (int) $_oDateIntervalScheduling->format('%Y%M%D%H%I%S');
@@ -69,8 +71,7 @@  discard block
 block discarded – undo
69 71
 
70 72
                 // if epsilon is less or equal than 30sec the not empty check is enough
71 73
                 return true;
72
-            }
73
-            catch (\Exception $_oException)
74
+            } catch (\Exception $_oException)
74 75
             {
75 76
                 // can't init \DateInterval instance
76 77
                 return false;
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
     }
47 47
 
48 48
     /**
49
-     * @param JobEntity $oJobEntity
49
+     * @param JobEntityInterface $oJobEntity
50 50
      * @return bool
51 51
      */
52 52
     private function isEpsilonPropertyValid(JobEntityInterface $oJobEntity)
Please login to merge, or discard this patch.
src/Service/JobValidator/PropertyValidator/Schedule.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,7 @@
 block discarded – undo
62 62
             {
63 63
                 $_oDataPeriod = $this->oDatePeriodFactory->createDatePeriod($oJobEntity->schedule, $oJobEntity->scheduleTimeZone);
64 64
                 return (false !== $_oDataPeriod);
65
-            }
66
-            catch (\Exception $oException)
65
+            } catch (\Exception $oException)
67 66
             {
68 67
                 // invalid: Iso8601 is not valid and/or DatePeriodFactory is able to create a valid DatePeriod
69 68
             }
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 
12 12
 
13 13
 use Chapi\Component\DatePeriod\DatePeriodFactoryInterface;
14
-use Chapi\Entity\Chronos\JobEntity;
15 14
 use Chapi\Entity\JobEntityInterface;
16 15
 use Chapi\Service\JobValidator\PropertyValidatorInterface;
17 16
 
Please login to merge, or discard this patch.
src/BusinessCase/Comparison/ChronosJobComparisonBusinessCase.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@
 block discarded – undo
46 46
 
47 47
 
48 48
     /**
49
-     * @param JobRepositoryInterface $oJobRepositoryLocal
49
+     * @param JobRepositoryInterface $oJobRepositoryLocalChronos
50 50
      * @param JobRepositoryInterface $oJobRepositoryChronos
51
-     * @param JobRepositoryInterface $oJobRepositoryMarathon
51
+     * @param JobRepositoryInterface $oJobRepositoryLocalChronos
52 52
      * @param DiffCompareInterface $oDiffCompare
53 53
      * @param DatePeriodFactoryInterface $oDatePeriodFactory
54 54
      * @param LoggerInterface $oLogger
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@
 block discarded – undo
11 11
 
12 12
 use Chapi\Component\Comparison\DiffCompareInterface;
13 13
 use Chapi\Component\DatePeriod\DatePeriodFactoryInterface;
14
-use Chapi\Entity\Chronos\JobCollection;
15 14
 use Chapi\Entity\Chronos\ChronosJobEntity;
15
+use Chapi\Entity\Chronos\JobCollection;
16 16
 use Chapi\Entity\JobEntityInterface;
17 17
 use Chapi\Service\JobRepository\JobRepositoryInterface;
18 18
 use Psr\Log\LoggerInterface;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
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
         );
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -317,8 +317,7 @@
 block discarded – undo
317 317
         {
318 318
             $_oDateTime = new \DateTime(str_replace('Z', '', $_oIso8601Entity->sStartTime));
319 319
             $_oDateTime->setTimezone(new \DateTimeZone($sTimeZone));
320
-        }
321
-        else
320
+        } else
322 321
         {
323 322
             $_oDateTime = new \DateTime($_oIso8601Entity->sStartTime);
324 323
         }
Please login to merge, or discard this patch.
src/BusinessCase/Comparison/MarathonJobComparisonBusinessCase.php 3 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,6 @@
 block discarded – undo
15 15
 use Chapi\Entity\Chronos\ChronosJobEntity;
16 16
 use Chapi\Entity\Chronos\JobCollection;
17 17
 use Chapi\Entity\JobEntityInterface;
18
-use Chapi\Entity\Marathon\AppEntity\FetchUrl;
19
-use Chapi\Entity\Marathon\AppEntity\PortDefinition;
20 18
 use Chapi\Entity\Marathon\MarathonAppEntity;
21 19
 use Chapi\Service\JobRepository\JobRepositoryInterface;
22 20
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -250,12 +250,10 @@  discard block
 block discarded – undo
250 250
     {
251 251
         if (is_array($mValueA) && is_array($mValueB)) {
252 252
             return $this->isArrayEqual($mValueA, $mValueB);
253
-        }
254
-        elseif (is_object($mValueA) && is_object($mValueB))
253
+        } elseif (is_object($mValueA) && is_object($mValueB))
255 254
         {
256 255
             return $this->isArrayEqual(get_object_vars($mValueA), get_object_vars($mValueB));
257
-        }
258
-        elseif ((is_scalar($mValueA) && is_scalar($mValueB)) || (is_null($mValueA) && is_null($mValueB)))
256
+        } elseif ((is_scalar($mValueA) && is_scalar($mValueB)) || (is_null($mValueA) && is_null($mValueB)))
259 257
         {
260 258
             return $mValueA == $mValueB;
261 259
         }
@@ -288,8 +286,7 @@  discard block
 block discarded – undo
288 286
                 {
289 287
                     return false;
290 288
                 }
291
-            }
292
-            else
289
+            } else
293 290
             {
294 291
                 foreach ($aValuesB as $_mValueB)
295 292
                 {
Please login to merge, or discard this patch.
src/BusinessCase/JobManagement/MarathonStoreJobBusinessCase.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -150,6 +150,9 @@  discard block
 block discarded – undo
150 150
         return !(count($arr) == count(array_unique($arr)));
151 151
     }
152 152
 
153
+    /**
154
+     * @param integer $immediateChildren
155
+     */
153 156
     private function isDependencyCircular(JobEntityInterface $oEntity, $immediateChildren, &$path=[])
154 157
     {
155 158
         // Invariant: path will not have duplicates for acyclic dependency tree
@@ -310,6 +313,9 @@  discard block
 block discarded – undo
310 313
         }
311 314
     }
312 315
 
316
+    /**
317
+     * @param boolean $bForceOverwrite
318
+     */
313 319
     private function updateJobInLocalRepository($oAppRemote, $bForceOverwrite)
314 320
     {
315 321
         $_aDiff = $this->oJobComparisionBusinessCase->getJobDiff($oAppRemote->getKey());
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Braces   +7 added lines, -10 removed lines patch added patch discarded remove patch
@@ -100,8 +100,7 @@  discard block
 block discarded – undo
100 100
                         ));
101 101
                         return false;
102 102
                     }
103
-                }
104
-                catch(\Exception $e)
103
+                } catch(\Exception $e)
105 104
                 {
106 105
                     $this->oLogger->error(sprintf(
107 106
                         "Job %s cannot be added to remote : %s",$sAppId, $e->getMessage()
@@ -268,8 +267,7 @@  discard block
 block discarded – undo
268 267
         if (empty($aJobNames))
269 268
         {
270 269
             $_aApps = $this->oJobRepositoryRemote->getJobs();
271
-        }
272
-        else
270
+        } else
273 271
         {
274 272
             $_aApps = [];
275 273
             foreach ($aJobNames as $_sAppName)
@@ -282,11 +280,12 @@  discard block
 block discarded – undo
282 280
         foreach ($_aApps as $_oAppRemote)
283 281
         {
284 282
             $_oAppLocal = $this->oJobRepositoryLocal->getJob($_oAppRemote->getKey());
285
-            if (null == $_oAppLocal) // add
283
+            if (null == $_oAppLocal) {
284
+                // add
286 285
             {
287 286
                 $this->addJobInLocalRepository($_oAppRemote);
288 287
             }
289
-            else // update
288
+            } else // update
290 289
             {
291 290
                 $this->updateJobInLocalRepository($_oAppRemote, $bForceOverwrite);
292 291
             }
@@ -301,8 +300,7 @@  discard block
 block discarded – undo
301 300
                 'App %s stored in local repository',
302 301
                 $oAppRemote->getKey()
303 302
             ));
304
-        }
305
-        else {
303
+        } else {
306 304
             $this->oLogger->error(sprintf(
307 305
                 'Failed to store %s in local repository',
308 306
                 $oAppRemote->getKey()
@@ -331,8 +329,7 @@  discard block
 block discarded – undo
331 329
                     'App %s is updated in local repository',
332 330
                     $oAppRemote->getKey()
333 331
                 ));
334
-            }
335
-            else {
332
+            } else {
336 333
                 $this->oLogger->error(sprintf(
337 334
                     'Failed to update app %s in local repository',
338 335
                     $oAppRemote->getKey()
Please login to merge, or discard this patch.
src/BusinessCase/JobManagement/StoreJobBusinessCaseFactoryInterface.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     /**
17 17
      * @param StoreJobBusinessCaseInterface $oStoreJob
18 18
      * @return
19
-     */
19
+     void
20 20
     public function addBusinesCase(StoreJobBusinessCaseInterface $oStoreJob);
21 21
 
22 22
     /**
Please login to merge, or discard this patch.
src/Component/RemoteClients/ChronosApiClient.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@
 block discarded – undo
11 11
 namespace Chapi\Component\RemoteClients;
12 12
 
13 13
 
14
-use Chapi\Component\RemoteClients\ApiClientInterface;
15 14
 use Chapi\Component\Http\HttpClientInterface;
15
+use Chapi\Component\RemoteClients\ApiClientInterface;
16 16
 use Chapi\Entity\Chronos\ChronosJobEntity;
17 17
 use Chapi\Entity\JobEntityInterface;
18 18
 use Chapi\Exception\ApiClientException;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/Entity/Marathon/AppSubEntityFactory.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -9,13 +9,11 @@
 block discarded – undo
9 9
 
10 10
 namespace Chapi\Entity\Marathon;
11 11
 
12
-use Chapi\Entity\Marathon\AppEntity;
13 12
 use Chapi\Entity\Marathon\AppEntity\Container;
14 13
 use Chapi\Entity\Marathon\AppEntity\FetchUrl;
15 14
 use Chapi\Entity\Marathon\AppEntity\HealthCheck;
16 15
 use Chapi\Entity\Marathon\AppEntity\PortDefinition;
17 16
 use Chapi\Entity\Marathon\AppEntity\UpgradeStrategy;
18
-use SebastianBergmann\Comparator\ExceptionComparatorTest;
19 17
 
20 18
 class AppSubEntityFactory implements AppSubEntityFactoryInterface
21 19
 {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
src/Service/JobRepository/BridgeFileSystem.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -347,6 +347,9 @@
 block discarded – undo
347 347
     }
348 348
 
349 349
 
350
+    /**
351
+     * @param string $sJobFile
352
+     */
350 353
     private function dumpFileWithGroup($sJobFile, JobEntityInterface $oJobEntity, $bAdd = true)
351 354
     {
352 355
         $_sGroupConfig = file_get_contents($sJobFile);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
             $_sJobPath = $oJobEntity->getKey();
162 162
         }
163 163
 
164
-        return $this->sRepositoryDir . DIRECTORY_SEPARATOR . $_sJobPath . '.json';
164
+        return $this->sRepositoryDir.DIRECTORY_SEPARATOR.$_sJobPath.'.json';
165 165
     }
166 166
 
167 167
     /**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
             throw new \RuntimeException(sprintf('Path "%s" is not valid', $sPath));
177 177
         }
178 178
 
179
-        $_aTemp = Glob::glob(rtrim($sPath, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*');
179
+        $_aTemp = Glob::glob(rtrim($sPath, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'*');
180 180
 
181 181
         foreach ($_aTemp as $_sPath)
182 182
         {
Please login to merge, or discard this patch.
Braces   +9 added lines, -8 removed lines patch added patch discarded remove patch
@@ -155,8 +155,7 @@  discard block
 block discarded – undo
155 155
                 DIRECTORY_SEPARATOR,
156 156
                 $oJobEntity->getKey()
157 157
             );
158
-        }
159
-        else
158
+        } else
160 159
         {
161 160
             $_sJobPath = $oJobEntity->getKey();
162 161
         }
@@ -268,15 +267,19 @@  discard block
 block discarded – undo
268 267
 
269 268
             if ($_aTemp)
270 269
             {
271
-                if (property_exists($_aTemp, "name")) // chronos
270
+                if (property_exists($_aTemp, "name")) {
271
+                    // chronos
272 272
                 {
273 273
                     $_aJobEntities[] = new ChronosJobEntity($_aTemp);
274
+                }
274 275
 
275
-                } else if (property_exists($_aTemp, "id")) //marathon
276
+                } else if (property_exists($_aTemp, "id")) {
277
+                    //marathon
276 278
                 {
277 279
                     foreach ($this->getMarathonEntitiesForConfig($_aTemp) as $_oApp)
278 280
                     {
279 281
                         $_aJobEntities[] = $_oApp;
282
+                }
280 283
                     }
281 284
                 } else {
282 285
                     throw new JobLoadException(
@@ -297,8 +300,7 @@  discard block
 block discarded – undo
297 300
                     $_aJobs[] = $_oJobEntity;
298 301
                 }
299 302
 
300
-            }
301
-            else
303
+            } else
302 304
             {
303 305
                 throw new JobLoadException(
304 306
                     sprintf('Unable to load json job data from "%s". Please check if the json is valid.', $_sJobFilePath),
@@ -323,8 +325,7 @@  discard block
 block discarded – undo
323 325
                 $this->aGroupedApps[] = $_oApp->id;
324 326
                 $_aRet[] = $_oGroupEntity;
325 327
             }
326
-        }
327
-        else
328
+        } else
328 329
         {
329 330
             $_aRet[] = new MarathonAppEntity($aEntityData);
330 331
         }
Please login to merge, or discard this patch.