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.php38
1 files changed, 19 insertions, 19 deletions
diff --git a/apps/dav/lib/CalDAV/Reminder/ReminderService.php b/apps/dav/lib/CalDAV/Reminder/ReminderService.php
index ad428eef745..f36ddd157cc 100644
--- a/apps/dav/lib/CalDAV/Reminder/ReminderService.php
+++ b/apps/dav/lib/CalDAV/Reminder/ReminderService.php
@@ -24,7 +24,7 @@ declare(strict_types=1);
*/
namespace OCA\DAV\CalDAV\Reminder;
-use DateTimeImmutable;
+use \DateTimeImmutable;
use OCA\DAV\CalDAV\CalDavBackend;
use OCP\AppFramework\Utility\ITimeFactory;
use OCP\IGroup;
@@ -40,11 +40,11 @@ use Sabre\VObject\Recur\NoInstancesException;
class ReminderService {
- /** @var Backend */
- private $backend;
+ /** @var Backend */
+ private $backend;
- /** @var NotificationProviderManager */
- private $notificationProviderManager;
+ /** @var NotificationProviderManager */
+ private $notificationProviderManager;
/** @var IUserManager */
private $userManager;
@@ -83,19 +83,19 @@ class ReminderService {
* @param CalDavBackend $caldavBackend
* @param ITimeFactory $timeFactory
*/
- public function __construct(Backend $backend,
- NotificationProviderManager $notificationProviderManager,
+ public function __construct(Backend $backend,
+ NotificationProviderManager $notificationProviderManager,
IUserManager $userManager,
IGroupManager $groupManager,
CalDavBackend $caldavBackend,
ITimeFactory $timeFactory) {
- $this->backend = $backend;
- $this->notificationProviderManager = $notificationProviderManager;
+ $this->backend = $backend;
+ $this->notificationProviderManager = $notificationProviderManager;
$this->userManager = $userManager;
$this->groupManager = $groupManager;
$this->caldavBackend = $caldavBackend;
$this->timeFactory = $timeFactory;
- }
+ }
/**
* Process reminders to activate
@@ -103,12 +103,12 @@ class ReminderService {
* @throws NotificationProvider\ProviderNotAvailableException
* @throws NotificationTypeDoesNotExistException
*/
- public function processReminders():void {
- $reminders = $this->backend->getRemindersToProcess();
+ public function processReminders():void {
+ $reminders = $this->backend->getRemindersToProcess();
- foreach($reminders as $reminder) {
- $vcalendar = $this->parseCalendarData($reminder['calendardata']);
- if (!$vcalendar) {
+ foreach($reminders as $reminder) {
+ $vcalendar = $this->parseCalendarData($reminder['calendardata']);
+ if (!$vcalendar) {
$this->backend->removeReminder($reminder['id']);
continue;
}
@@ -140,7 +140,7 @@ class ReminderService {
$this->deleteOrProcessNext($reminder, $vevent);
}
- }
+ }
/**
* @param string $action
@@ -175,7 +175,7 @@ class ReminderService {
/**
* @param array $objectData
*/
- private function onCalendarObjectCreate(array $objectData):void {
+ private function onCalendarObjectCreate(array $objectData):void {
/** @var VObject\Component\VCalendar $vcalendar */
$vcalendar = $this->parseCalendarData($objectData['calendardata']);
if (!$vcalendar) {
@@ -343,7 +343,7 @@ class ReminderService {
'is_repeat_based' => false,
];
- $repeat = $valarm->REPEAT ? (int) $valarm->REPEAT : 0;
+ $repeat = isset($valarm->REPEAT) ? (int) $valarm->REPEAT->getValue() : 0;
for($i = 0; $i < $repeat; $i++) {
if ($valarm->DURATION === null) {
continue;
@@ -671,7 +671,7 @@ class ReminderService {
return null;
}
- if (strcasecmp($principalUri, 'principals/users/') !== 0) {
+ if (stripos($principalUri, 'principals/users/') !== 0) {
return null;
}