summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CalDAV/Reminder/ReminderService.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/CalDAV/Reminder/ReminderService.php')
-rw-r--r--apps/dav/lib/CalDAV/Reminder/ReminderService.php29
1 files changed, 14 insertions, 15 deletions
diff --git a/apps/dav/lib/CalDAV/Reminder/ReminderService.php b/apps/dav/lib/CalDAV/Reminder/ReminderService.php
index 48feaa0c589..7cf2d52768d 100644
--- a/apps/dav/lib/CalDAV/Reminder/ReminderService.php
+++ b/apps/dav/lib/CalDAV/Reminder/ReminderService.php
@@ -111,7 +111,7 @@ class ReminderService {
public function processReminders():void {
$reminders = $this->backend->getRemindersToProcess();
- foreach($reminders as $reminder) {
+ foreach ($reminders as $reminder) {
$calendarData = is_resource($reminder['calendardata'])
? stream_get_contents($reminder['calendardata'])
: $reminder['calendardata'];
@@ -163,7 +163,7 @@ class ReminderService {
return;
}
- switch($action) {
+ switch ($action) {
case '\OCA\DAV\CalDAV\CalDavBackend::createCalendarObject':
$this->onCalendarObjectCreate($objectData);
break;
@@ -206,14 +206,14 @@ class ReminderService {
$now = $this->timeFactory->getDateTime();
$isRecurring = $masterItem ? $this->isRecurring($masterItem) : false;
- foreach($recurrenceExceptions as $recurrenceException) {
+ foreach ($recurrenceExceptions as $recurrenceException) {
$eventHash = $this->getEventHash($recurrenceException);
if (!isset($recurrenceException->VALARM)) {
continue;
}
- foreach($recurrenceException->VALARM as $valarm) {
+ foreach ($recurrenceException->VALARM as $valarm) {
/** @var VAlarm $valarm */
$alarmHash = $this->getAlarmHash($valarm);
$triggerTime = $valarm->getEffectiveTriggerTime();
@@ -237,7 +237,7 @@ class ReminderService {
return;
}
- foreach($masterItem->VALARM as $valarm) {
+ foreach ($masterItem->VALARM as $valarm) {
$masterAlarms[] = $this->getAlarmHash($valarm);
}
@@ -250,7 +250,7 @@ class ReminderService {
return;
}
- while($iterator->valid() && count($processedAlarms) < count($masterAlarms)) {
+ while ($iterator->valid() && count($processedAlarms) < count($masterAlarms)) {
$event = $iterator->getEventObject();
// Recurrence-exceptions are handled separately, so just ignore them here
@@ -259,7 +259,7 @@ class ReminderService {
continue;
}
- foreach($event->VALARM as $valarm) {
+ foreach ($event->VALARM as $valarm) {
/** @var VAlarm $valarm */
$alarmHash = $this->getAlarmHash($valarm);
if (\in_array($alarmHash, $processedAlarms, true)) {
@@ -365,7 +365,7 @@ class ReminderService {
];
$repeat = isset($valarm->REPEAT) ? (int) $valarm->REPEAT->getValue() : 0;
- for($i = 0; $i < $repeat; $i++) {
+ for ($i = 0; $i < $repeat; $i++) {
if ($valarm->DURATION === null) {
continue;
}
@@ -394,7 +394,7 @@ class ReminderService {
* @param array $reminders
*/
private function writeRemindersToDatabase(array $reminders): void {
- foreach($reminders as $reminder) {
+ foreach ($reminders as $reminder) {
$this->backend->insertReminder(
(int) $reminder['calendar_id'],
(int) $reminder['object_id'],
@@ -422,7 +422,6 @@ class ReminderService {
!$reminder['is_recurring'] ||
!$reminder['is_relative'] ||
$reminder['is_recurrence_exception']) {
-
$this->backend->removeReminder($reminder['id']);
return;
}
@@ -440,7 +439,7 @@ class ReminderService {
return;
}
- while($iterator->valid()) {
+ while ($iterator->valid()) {
$event = $iterator->getEventObject();
// Recurrence-exceptions are handled separately, so just ignore them here
@@ -455,7 +454,7 @@ class ReminderService {
continue;
}
- foreach($event->VALARM as $valarm) {
+ foreach ($event->VALARM as $valarm) {
/** @var VAlarm $valarm */
$alarmHash = $this->getAlarmHash($valarm);
if ($alarmHash !== $reminder['alarm_hash']) {
@@ -608,7 +607,7 @@ class ReminderService {
// Handle recurrence-exceptions first, because recurrence-expansion is expensive
if ($isRecurrenceException) {
- foreach($recurrenceExceptions as $recurrenceException) {
+ foreach ($recurrenceExceptions as $recurrenceException) {
if ($this->getEffectiveRecurrenceIdOfVEvent($recurrenceException) === $recurrenceId) {
return $recurrenceException;
}
@@ -678,7 +677,7 @@ class ReminderService {
try {
return VObject\Reader::read($calendarData,
VObject\Reader::OPTION_FORGIVING);
- } catch(ParseException $ex) {
+ } catch (ParseException $ex) {
return null;
}
}
@@ -707,7 +706,7 @@ class ReminderService {
private function getAllVEventsFromVCalendar(VObject\Component\VCalendar $vcalendar):array {
$vevents = [];
- foreach($vcalendar->children() as $child) {
+ foreach ($vcalendar->children() as $child) {
if (!($child instanceof VObject\Component)) {
continue;
}