aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/CalDAV/Reminder
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/CalDAV/Reminder')
-rw-r--r--apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php2
-rw-r--r--apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php8
-rw-r--r--apps/dav/lib/CalDAV/Reminder/NotificationProvider/ProviderNotAvailableException.php1
-rw-r--r--apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php2
-rw-r--r--apps/dav/lib/CalDAV/Reminder/NotificationTypeDoesNotExistException.php1
-rw-r--r--apps/dav/lib/CalDAV/Reminder/Notifier.php2
-rw-r--r--apps/dav/lib/CalDAV/Reminder/ReminderService.php29
7 files changed, 21 insertions, 24 deletions
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php
index 61373327c6c..00dee6b0907 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/AbstractProvider.php
@@ -44,7 +44,7 @@ use Sabre\VObject\Property;
*
* @package OCA\DAV\CalDAV\Reminder\NotificationProvider
*/
-abstract class AbstractProvider implements INotificationProvider {
+abstract class AbstractProvider implements INotificationProvider {
/** @var string */
public const NOTIFICATION_TYPE = '';
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php
index 3893d24d802..b675b09e427 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/EmailProvider.php
@@ -99,7 +99,7 @@ class EmailProvider extends AbstractProvider {
$sortedByLanguage = $this->sortEMailAddressesByLanguage($emailAddresses, $fallbackLanguage);
$organizer = $this->getOrganizerEMailAndNameFromEvent($vevent);
- foreach($sortedByLanguage as $lang => $emailAddresses) {
+ foreach ($sortedByLanguage as $lang => $emailAddresses) {
if (!$this->hasL10NForLang($lang)) {
$lang = $fallbackLanguage;
}
@@ -212,7 +212,7 @@ class EmailProvider extends AbstractProvider {
string $defaultLanguage):array {
$sortedByLanguage = [];
- foreach($emails as $emailAddress => $parameters) {
+ foreach ($emails as $emailAddress => $parameters) {
if (isset($parameters['LANG'])) {
$lang = $parameters['LANG'];
} else {
@@ -260,7 +260,7 @@ class EmailProvider extends AbstractProvider {
}
$emailAddressesOfDelegates = $delegates->getParts();
- foreach($emailAddressesOfDelegates as $addressesOfDelegate) {
+ foreach ($emailAddressesOfDelegates as $addressesOfDelegate) {
if (strcasecmp($addressesOfDelegate, 'mailto:') === 0) {
$emailAddresses[substr($addressesOfDelegate, 7)] = [];
}
@@ -345,7 +345,7 @@ class EmailProvider extends AbstractProvider {
private function getEMailAddressesOfAllUsersWithWriteAccessToCalendar(array $users):array {
$emailAddresses = [];
- foreach($users as $user) {
+ foreach ($users as $user) {
$emailAddress = $user->getEMailAddress();
if ($emailAddress) {
$lang = $this->getLangForUser($user);
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/ProviderNotAvailableException.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/ProviderNotAvailableException.php
index c83865d1eea..e6c41d02ac4 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/ProviderNotAvailableException.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/ProviderNotAvailableException.php
@@ -39,5 +39,4 @@ class ProviderNotAvailableException extends \Exception {
public function __construct(string $type) {
parent::__construct("No notification provider for type $type available");
}
-
}
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php
index 0074b5c201c..f3da0c03a68 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationProvider/PushProvider.php
@@ -97,7 +97,7 @@ class PushProvider extends AbstractProvider {
// Empty Notification ObjectId will be catched by OC\Notification\Notification
$eventUUIDHash = $eventUUID ? hash('sha256', $eventUUID, false) : '';
- foreach($users as $user) {
+ foreach ($users as $user) {
/** @var INotification $notification */
$notification = $this->manager->createNotification();
$notification->setApp(Application::APP_ID)
diff --git a/apps/dav/lib/CalDAV/Reminder/NotificationTypeDoesNotExistException.php b/apps/dav/lib/CalDAV/Reminder/NotificationTypeDoesNotExistException.php
index 2f182937a93..1b144fdbbf0 100644
--- a/apps/dav/lib/CalDAV/Reminder/NotificationTypeDoesNotExistException.php
+++ b/apps/dav/lib/CalDAV/Reminder/NotificationTypeDoesNotExistException.php
@@ -38,5 +38,4 @@ class NotificationTypeDoesNotExistException extends \Exception {
public function __construct(string $type) {
parent::__construct("Type $type is not an accepted type of notification");
}
-
}
diff --git a/apps/dav/lib/CalDAV/Reminder/Notifier.php b/apps/dav/lib/CalDAV/Reminder/Notifier.php
index c436d4fc329..93390f537ef 100644
--- a/apps/dav/lib/CalDAV/Reminder/Notifier.php
+++ b/apps/dav/lib/CalDAV/Reminder/Notifier.php
@@ -110,7 +110,7 @@ class Notifier implements INotifier {
$this->l10n = $this->l10nFactory->get('dav', $languageCode);
// Handle notifier subjects
- switch($notification->getSubject()) {
+ switch ($notification->getSubject()) {
case 'calendar_reminder':
return $this->prepareReminderNotification($notification);
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;
}