| @@ -47,7 +47,7 @@ | ||
| 47 | 47 | } | 
| 48 | 48 | |
| 49 | 49 | /** | 
| 50 | - * @return array | |
| 50 | + * @return string[] | |
| 51 | 51 | */ | 
| 52 | 52 | private function parseIsoString() | 
| 53 | 53 |      { | 
| @@ -37,8 +37,7 @@ discard block | ||
| 37 | 37 | if (!empty($_sJobName)) | 
| 38 | 38 |          { | 
| 39 | 39 | $this->printJobDiff($_sJobName); | 
| 40 | - } | |
| 41 | - else | |
| 40 | + } else | |
| 42 | 41 |          { | 
| 43 | 42 | $_aLocalJobUpdates = $_oJobComparisonBusinessCase->getLocalJobUpdates(); | 
| 44 | 43 | if (!empty($_aLocalJobUpdates)) | 
| @@ -76,12 +75,10 @@ discard block | ||
| 76 | 75 | if ($_sDiffSign == '+') | 
| 77 | 76 |                  { | 
| 78 | 77 |                      $this->oOutput->writeln(sprintf("<info>%s\t%s: %s</info>", $_sDiffSign, $_sProperty, substr($_sDiffLine, 1))); | 
| 79 | - } | |
| 80 | - elseif ($_sDiffSign == '-') | |
| 78 | + } elseif ($_sDiffSign == '-') | |
| 81 | 79 |                  { | 
| 82 | 80 |                      $this->oOutput->writeln(sprintf("<fg=red>%s\t%s: %s</>", $_sDiffSign, $_sProperty, substr($_sDiffLine, 1))); | 
| 83 | - } | |
| 84 | - else | |
| 81 | + } else | |
| 85 | 82 |                  { | 
| 86 | 83 |                      $this->oOutput->writeln(sprintf("\t%s: %s", $_sProperty, $_sDiffLine)); | 
| 87 | 84 | } | 
| @@ -49,8 +49,7 @@ | ||
| 49 | 49 | $_mValue = (!empty($_mValue)) | 
| 50 | 50 |                      ? '[ ' . implode(', ', $_mValue) . ' ]' | 
| 51 | 51 | : '[ ]'; | 
| 52 | - } | |
| 53 | - elseif (is_bool($_mValue)) | |
| 52 | + } elseif (is_bool($_mValue)) | |
| 54 | 53 |              { | 
| 55 | 54 | $_mValue = (true === $_mValue) | 
| 56 | 55 | ? 'true' | 
| @@ -49,8 +49,7 @@ | ||
| 49 | 49 | if (JobUtils::isWildcard($aJobNames)) | 
| 50 | 50 |          { | 
| 51 | 51 | $_oJobIndexService->resetJobIndex(); | 
| 52 | - } | |
| 53 | - else | |
| 52 | + } else | |
| 54 | 53 |          { | 
| 55 | 54 | $_oJobIndexService->removeJobs($aJobNames); | 
| 56 | 55 | } | 
| @@ -250,13 +250,11 @@ discard block | ||
| 250 | 250 |                  { | 
| 251 | 251 |                      $_sTimeline .= $this->parseTimeLineStrMark($_bPrintJobStart, $_bPrintJobEnd, $_bHasToCloseFinalTag, $_oTime->format('H>i'), $_oTime->format('H:i')); | 
| 252 | 252 | |
| 253 | - } | |
| 254 | - else | |
| 253 | + } else | |
| 255 | 254 |                  { | 
| 256 | 255 |                      $_sTimeline .= $this->parseTimeLineStrMark($_bPrintJobStart, $_bPrintJobEnd, $_bHasToCloseFinalTag, str_repeat('>', 5), str_repeat($_sSpacer, 5)); | 
| 257 | 256 | } | 
| 258 | - } | |
| 259 | - else | |
| 257 | + } else | |
| 260 | 258 |              { | 
| 261 | 259 | $_sTimeline .= $this->parseTimeLineStrMark($_bPrintJobStart, $_bPrintJobEnd, $_bHasToCloseFinalTag, '>', $_sSpacer); | 
| 262 | 260 | } | 
| @@ -284,18 +282,15 @@ discard block | ||
| 284 | 282 | if ($bPrintJobStart && $bPrintJobEnd) | 
| 285 | 283 |          { | 
| 286 | 284 |              $_sTimelineSnippet = sprintf('<comment>%s</comment>', $sStartStopMark); | 
| 287 | - } | |
| 288 | - elseif ($bPrintJobStart) | |
| 285 | + } elseif ($bPrintJobStart) | |
| 289 | 286 |          { | 
| 290 | 287 |              $_sTimelineSnippet = sprintf('<comment>%s', $sStartStopMark); | 
| 291 | 288 | $bHasToCloseFinalTag = true; | 
| 292 | - } | |
| 293 | - elseif ($bPrintJobEnd) | |
| 289 | + } elseif ($bPrintJobEnd) | |
| 294 | 290 |          { | 
| 295 | 291 |              $_sTimelineSnippet = sprintf('%s</comment>', $sStartStopMark); | 
| 296 | 292 | $bHasToCloseFinalTag = false; | 
| 297 | - } | |
| 298 | - else | |
| 293 | + } else | |
| 299 | 294 |          { | 
| 300 | 295 | $_sTimelineSnippet = $sSpacer; | 
| 301 | 296 | } | 
| @@ -73,7 +73,7 @@ discard block | ||
| 73 | 73 | $_iStartTime = ($_sStartTime == null) ? $_iCurrentTime : strtotime($_sStartTime); | 
| 74 | 74 | if ($_sStartTime != null && $_iStartTime < $_iCurrentTime) | 
| 75 | 75 |          { | 
| 76 | - $_iStartTime = strtotime($_sStartTime . ' + 24 hours'); | |
| 76 | + $_iStartTime = strtotime($_sStartTime.' + 24 hours'); | |
| 77 | 77 | } | 
| 78 | 78 | |
| 79 | 79 | $_iEndTime = ($_sEndTime == null) ? $_iStartTime + 7200 : strtotime($_sEndTime); | 
| @@ -95,7 +95,7 @@ discard block | ||
| 95 | 95 | $_oTable = new Table($this->oOutput); | 
| 96 | 96 | $_oTable->setHeaders(array( | 
| 97 | 97 | 'Job', | 
| 98 | -            'Timeline for ' . date('Y-m-d H:i', $iStartTime) . ' till ' . date('Y-m-d H:i', $iEndTime) | |
| 98 | +            'Timeline for '.date('Y-m-d H:i', $iStartTime).' till '.date('Y-m-d H:i', $iEndTime) | |
| 99 | 99 | )); | 
| 100 | 100 | |
| 101 | 101 | $_aJobs = $this->getJobsWhichShouldStartInPeriod($iStartTime, $iEndTime); | 
| @@ -163,7 +163,7 @@ discard block | ||
| 163 | 163 | |
| 164 | 164 | $oTable->addRow( | 
| 165 | 165 | array( | 
| 166 | -                    str_repeat('   ', $iCurrentChildLevel) . '|_ ' . $_sChildJobName, | |
| 166 | +                    str_repeat('   ', $iCurrentChildLevel).'|_ '.$_sChildJobName, | |
| 167 | 167 | $this->getTimelineStr( | 
| 168 | 168 | $oDisplayPeriod, | 
| 169 | 169 | $oJobDatePeriod, | 
| @@ -317,7 +317,7 @@ discard block | ||
| 317 | 317 |          { | 
| 318 | 318 | if ($iJobStartTimeDelay > 0) | 
| 319 | 319 |              { | 
| 320 | -                $_oJobTime->add(new \DateInterval('PT' . $iJobStartTimeDelay . 'S')); | |
| 320 | +                $_oJobTime->add(new \DateInterval('PT'.$iJobStartTimeDelay.'S')); | |
| 321 | 321 | } | 
| 322 | 322 | |
| 323 | 323 |              $_aStartTimes[$_oJobTime->format('YmdHi')] = $_oJobTime; | 
| @@ -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 | } | 
| @@ -58,8 +57,7 @@ discard block | ||
| 58 | 57 |          { | 
| 59 | 58 |              $_oDateStart = new \DateTime(str_replace('Z', '', $_oIso8601Entity->sStartTime)); | 
| 60 | 59 | $_oDateStart->setTimezone(new \DateTimeZone($sTimeZone)); | 
| 61 | - } | |
| 62 | - else | |
| 60 | + } else | |
| 63 | 61 |          { | 
| 64 | 62 | $_oDateStart = new \DateTime($_oIso8601Entity->sStartTime); | 
| 65 | 63 | } | 
| @@ -51,8 +51,7 @@ | ||
| 51 | 51 | ); | 
| 52 | 52 | |
| 53 | 53 | return new HttpGuzzlResponse($_oResponse); | 
| 54 | - } | |
| 55 | - catch (\Exception $oException) | |
| 54 | + } catch (\Exception $oException) | |
| 56 | 55 |          { | 
| 57 | 56 | throw new HttpConnectionException( | 
| 58 | 57 |                  sprintf('Can\'t get response from "%s"', $this->oGuzzelClient->getBaseUrl() . $sUrl), | 
| @@ -9,8 +9,8 @@ | ||
| 9 | 9 | |
| 10 | 10 | namespace Chapi\Component\Http; | 
| 11 | 11 | |
| 12 | -use Chapi\Exception\HttpConnectionException; | |
| 13 | 12 | use Chapi\Entity\Http\AuthEntity; | 
| 13 | +use Chapi\Exception\HttpConnectionException; | |
| 14 | 14 | use GuzzleHttp\ClientInterface; | 
| 15 | 15 | |
| 16 | 16 | class HttpGuzzlClient implements HttpClientInterface | 
| @@ -58,7 +58,7 @@ | ||
| 58 | 58 | catch (\Exception $oException) | 
| 59 | 59 |          { | 
| 60 | 60 | throw new HttpConnectionException( | 
| 61 | -                sprintf('Can\'t get response from "%s"', $this->oGuzzelClient->getConfig('base_uri') . $sUrl), | |
| 61 | +                sprintf('Can\'t get response from "%s"', $this->oGuzzelClient->getConfig('base_uri').$sUrl), | |
| 62 | 62 | 0, | 
| 63 | 63 | $oException | 
| 64 | 64 | ); | 
| @@ -230,8 +230,7 @@ | ||
| 230 | 230 | // set path to job file map | 
| 231 | 231 | $this->setJobFileToMap($_oJobEntity->name, $_sJobFilePath); | 
| 232 | 232 | } | 
| 233 | - } | |
| 234 | - else | |
| 233 | + } else | |
| 235 | 234 |              { | 
| 236 | 235 | throw new JobLoadException( | 
| 237 | 236 |                      sprintf('Unable to load json job data from "%s". Please check if the json is valid.', $_sJobFilePath), | 
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | <?php | 
| 2 | 2 | /** | 
| 3 | - * @package: chapi | |
| 4 | - * | |
| 5 | - * @author: msiebeneicher | |
| 6 | - * @since: 2015-07-29 | |
| 7 | - * | |
| 8 | - */ | |
| 3 | + * @package: chapi | |
| 4 | + * | |
| 5 | + * @author: msiebeneicher | |
| 6 | + * @since: 2015-07-29 | |
| 7 | + * | |
| 8 | + */ | |
| 9 | 9 | |
| 10 | 10 | namespace Chapi\Service\JobRepository; | 
| 11 | 11 | |
| @@ -125,7 +125,7 @@ discard block | ||
| 125 | 125 | DIRECTORY_SEPARATOR, | 
| 126 | 126 | $oJobEntity->name | 
| 127 | 127 | ); | 
| 128 | - return $this->sRepositoryDir . DIRECTORY_SEPARATOR . $_sJobPath . '.json'; | |
| 128 | + return $this->sRepositoryDir.DIRECTORY_SEPARATOR.$_sJobPath.'.json'; | |
| 129 | 129 | } | 
| 130 | 130 | |
| 131 | 131 | /** | 
| @@ -140,7 +140,7 @@ discard block | ||
| 140 | 140 |              throw new \RuntimeException(sprintf('Path "%s" is not valid', $sPath)); | 
| 141 | 141 | } | 
| 142 | 142 | |
| 143 | - $_aTemp = Glob::glob(rtrim($sPath, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '*'); | |
| 143 | + $_aTemp = Glob::glob(rtrim($sPath, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'*'); | |
| 144 | 144 | |
| 145 | 145 | foreach ($_aTemp as $_sPath) | 
| 146 | 146 |          { | 
| @@ -84,10 +84,12 @@ | ||
| 84 | 84 |      { | 
| 85 | 85 | if ($this->oRepositoryBridge->addJob($oJobEntity)) | 
| 86 | 86 |          { | 
| 87 | - if (!is_null($this->oJobCollection)) // if no collection inited the new job will init by chronos request | |
| 87 | +            if (!is_null($this->oJobCollection)) { | |
| 88 | + // if no collection inited the new job will init by chronos request | |
| 88 | 89 |              { | 
| 89 | 90 | $this->oJobCollection->offsetSet($oJobEntity->name, $oJobEntity); | 
| 90 | 91 | } | 
| 92 | + } | |
| 91 | 93 | |
| 92 | 94 | return true; | 
| 93 | 95 | } |