@@ -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), |
@@ -138,8 +138,7 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | $_oDataPeriod = $this->oDatePeriodFactory->createDatePeriod($oJobEntity->schedule, $oJobEntity->scheduleTimeZone); |
| 140 | 140 | return (false !== $_oDataPeriod); |
| 141 | - } |
|
| 142 | - catch (DatePeriodException $oException) |
|
| 141 | + } catch (DatePeriodException $oException) |
|
| 143 | 142 | { |
| 144 | 143 | // invalid: Iso8601 is not valid and/or DatePeriodFactory is able to create a valid DatePeriod |
| 145 | 144 | } |
@@ -161,9 +160,11 @@ discard block |
||
| 161 | 160 | $_oDateIntervalEpsilon = new \DateInterval($oJobEntity->epsilon); |
| 162 | 161 | $_iIntervalEpsilon = (int) $_oDateIntervalEpsilon->format('%Y%M%D%H%I%S'); |
| 163 | 162 | |
| 164 | - if ($_iIntervalEpsilon > 30) // if epsilon > "PT30S" |
|
| 163 | + if ($_iIntervalEpsilon > 30) { |
|
| 164 | + // if epsilon > "PT30S" |
|
| 165 | 165 | { |
| 166 | 166 | $_oIso8601Entity = $this->oDatePeriodFactory->createIso8601Entity($oJobEntity->schedule); |
| 167 | + } |
|
| 167 | 168 | |
| 168 | 169 | $_oDateIntervalScheduling = new \DateInterval($_oIso8601Entity->sInterval); |
| 169 | 170 | $_iIntervalScheduling = (int) $_oDateIntervalScheduling->format('%Y%M%D%H%I%S'); |
@@ -173,8 +174,7 @@ discard block |
||
| 173 | 174 | |
| 174 | 175 | // if epsilon is less or equal than 30sec the not empty check is enough |
| 175 | 176 | return true; |
| 176 | - } |
|
| 177 | - catch (\Exception $_oException) |
|
| 177 | + } catch (\Exception $_oException) |
|
| 178 | 178 | { |
| 179 | 179 | // can't init \DateInterval instance |
| 180 | 180 | return false; |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package: chapi |
|
| 4 | - * |
|
| 5 | - * @author: msiebeneicher |
|
| 6 | - * @since: 2015-07-31 |
|
| 7 | - * |
|
| 8 | - */ |
|
| 3 | + * @package: chapi |
|
| 4 | + * |
|
| 5 | + * @author: msiebeneicher |
|
| 6 | + * @since: 2015-07-31 |
|
| 7 | + * |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | |
| 11 | 11 | namespace Chapi\Service\JobRepository; |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package: chapi |
|
| 4 | - * |
|
| 5 | - * @author: msiebeneicher |
|
| 6 | - * @since: 2015-07-31 |
|
| 7 | - * |
|
| 8 | - */ |
|
| 3 | + * @package: chapi |
|
| 4 | + * |
|
| 5 | + * @author: msiebeneicher |
|
| 6 | + * @since: 2015-07-31 |
|
| 7 | + * |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | |
| 11 | 11 | namespace Chapi\Service\JobRepository; |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package: chapi |
|
| 4 | - * |
|
| 5 | - * @author: msiebeneicher |
|
| 6 | - * @since: 2015-08-28 |
|
| 7 | - */ |
|
| 3 | + * @package: chapi |
|
| 4 | + * |
|
| 5 | + * @author: msiebeneicher |
|
| 6 | + * @since: 2015-08-28 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | |
| 10 | 10 | namespace Chapi\Service\JobRepository; |
@@ -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 | } |
@@ -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 | |
| 11 | 11 | namespace Chapi\Service\JobRepository; |
@@ -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 | } |
@@ -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 | |
| 11 | 11 | namespace Chapi\Service\JobRepository; |
@@ -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 | |
| 11 | 11 | namespace Chapi\Service\JobRepository; |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package: Chapi |
|
| 4 | - * |
|
| 5 | - * @author: msiebeneicher |
|
| 6 | - * @since: 2015-07-31 |
|
| 7 | - * |
|
| 8 | - */ |
|
| 3 | + * @package: Chapi |
|
| 4 | + * |
|
| 5 | + * @author: msiebeneicher |
|
| 6 | + * @since: 2015-07-31 |
|
| 7 | + * |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | |
| 11 | 11 | namespace Chapi\Service\JobIndex; |
@@ -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) |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @package: Chapi |
|
| 4 | - * |
|
| 5 | - * @author: msiebeneicher |
|
| 6 | - * @since: 2015-07-31 |
|
| 7 | - * |
|
| 8 | - */ |
|
| 3 | + * @package: Chapi |
|
| 4 | + * |
|
| 5 | + * @author: msiebeneicher |
|
| 6 | + * @since: 2015-07-31 |
|
| 7 | + * |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | |
| 11 | 11 | namespace Chapi\Service\JobIndex; |