@@ -35,7 +35,7 @@ |
||
35 | 35 | public function throwExceptionOnInvalidParameter($rRule, $ruleKey) |
36 | 36 | { |
37 | 37 | if ((preg_match(sprintf('/%s=([\d\w]+)/', $ruleKey), $rRule, $matches) === 1)) { |
38 | - throw new InvalidRruleException($ruleKey, ((count($matches) > 0)? implode(', ', array_slice($matches, 1)) : '')); |
|
38 | + throw new InvalidRruleException($ruleKey, ((count($matches) > 0) ? implode(', ', array_slice($matches, 1)) : '')); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | } |
@@ -30,7 +30,7 @@ |
||
30 | 30 | protected function validate(array $values) |
31 | 31 | { |
32 | 32 | if (!isset($values[0]) || !is_numeric($values[0])) { |
33 | - throw new InvalidRruleException(CountExtractor::RRULE_PARAMETER, ((isset($values[0]))? (string) $values[0] : '')); |
|
33 | + throw new InvalidRruleException(CountExtractor::RRULE_PARAMETER, ((isset($values[0])) ? (string) $values[0] : '')); |
|
34 | 34 | } |
35 | 35 | } |
36 | 36 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | protected function validate(array $values) |
20 | 20 | { |
21 | 21 | if (!isset($values[0]) || !is_numeric($values[0])) { |
22 | - throw new InvalidRruleException(IntervalExtractor::RRULE_PARAMETER, ((isset($values[0]))? (string) $values[0] : '')); |
|
22 | + throw new InvalidRruleException(IntervalExtractor::RRULE_PARAMETER, ((isset($values[0])) ? (string) $values[0] : '')); |
|
23 | 23 | } |
24 | 24 | } |
25 | 25 | } |
@@ -60,7 +60,7 @@ |
||
60 | 60 | |
61 | 61 | try { |
62 | 62 | RecurrenceValidator::validate($recurrence); |
63 | - } catch (InvalidRecurrenceException $e) { |
|
63 | + } catch (InvalidRecurrenceException $e) { |
|
64 | 64 | throw new InvalidRruleExpressionException($e->getMessage()); |
65 | 65 | } |
66 | 66 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | { |
20 | 20 | $interval = $recurrence->getFrequency()->convertToDateIntervalFormat(); |
21 | 21 | |
22 | - $periodEndAt = ($recurrence->hasPeriodEndAt())? $recurrence->getPeriodEndAt() : $this->estimatePeriodEndAt($recurrence) ; |
|
22 | + $periodEndAt = ($recurrence->hasPeriodEndAt()) ? $recurrence->getPeriodEndAt() : $this->estimatePeriodEndAt($recurrence); |
|
23 | 23 | |
24 | 24 | // Transform interval in Datetime interval expression |
25 | 25 | if ($recurrence->getInterval() !== 1) { |
@@ -20,7 +20,7 @@ |
||
20 | 20 | { |
21 | 21 | $provider = new OptimizedProvider(); |
22 | 22 | |
23 | - if( |
|
23 | + if ( |
|
24 | 24 | $recurrence->hasConstraint(EndOfMonthConstraint::class) && |
25 | 25 | (string) $recurrence->getFrequency() == Frequency::FREQUENCY_MONTHLY && |
26 | 26 | in_array((int) $recurrence->getPeriodStartAt()->format('d'), [29, 30, 31]) |
@@ -17,13 +17,13 @@ |
||
17 | 17 | */ |
18 | 18 | public function provide(Recurrence $recurrence) |
19 | 19 | { |
20 | - $periodEndAt = ($recurrence->hasPeriodEndAt())? $recurrence->getPeriodEndAt() : $this->estimatePeriodEndAt($recurrence) ; |
|
20 | + $periodEndAt = ($recurrence->hasPeriodEndAt()) ? $recurrence->getPeriodEndAt() : $this->estimatePeriodEndAt($recurrence); |
|
21 | 21 | |
22 | 22 | $recurrences = []; |
23 | 23 | |
24 | 24 | $date = clone $recurrence->getPeriodStartAt(); |
25 | 25 | |
26 | - while($date < $periodEndAt) { |
|
26 | + while ($date < $periodEndAt) { |
|
27 | 27 | $recurrences[] = clone $date; |
28 | 28 | $date->modify('last day of next month'); |
29 | 29 | } |