Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/event_update_notification.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-04-08 23:04:40 +0300
committerJoas Schilling <coding@schilljs.com>2022-04-08 23:12:56 +0300
commit9159bae74a460e3951fdad3cc05ae8333e3045b1 (patch)
tree9090c56287c72e6a348b7b6616588ed3a5509c99
parentba7b09b197791cff66c82d38a5141fc68676aeaa (diff)
Run cs:fix
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/EventListener.php9
-rw-r--r--lib/Notifier.php12
2 files changed, 11 insertions, 10 deletions
diff --git a/lib/EventListener.php b/lib/EventListener.php
index 240a640..528cc30 100644
--- a/lib/EventListener.php
+++ b/lib/EventListener.php
@@ -1,4 +1,5 @@
<?php
+
declare(strict_types=1);
/**
* @copyright Copyright (c) 2018, Joas Schilling <coding@schilljs.com>
@@ -72,7 +73,7 @@ class EventListener implements IEventListener {
if ($event instanceof CalendarObjectCreatedEvent) {
$subject = Notifier::SUBJECT_OBJECT_ADD;
- } else if ($event instanceof CalendarObjectUpdatedEvent) {
+ } elseif ($event instanceof CalendarObjectUpdatedEvent) {
$subject = Notifier::SUBJECT_OBJECT_UPDATE;
} else {
if ($event instanceof CalendarObjectDeletedEvent
@@ -118,7 +119,7 @@ class EventListener implements IEventListener {
$classification = $objectData['classification'] ?? CalDavBackend::CLASSIFICATION_PUBLIC;
$action .= '_' . $object['type'];
- list ($dateTime, $hasTime) = $this->getNearestDateTime($objectData['calendardata']);
+ list($dateTime, $hasTime) = $this->getNearestDateTime($objectData['calendardata']);
$now = new \DateTime();
if ($dateTime < $now) {
@@ -177,7 +178,7 @@ class EventListener implements IEventListener {
protected function getObjectNameAndType(array $objectData) {
$vObject = Reader::read($objectData['calendardata']);
$component = $componentType = null;
- foreach($vObject->getComponents() as $component) {
+ foreach ($vObject->getComponents() as $component) {
if (\in_array($component->name, ['VEVENT', 'VTODO'])) {
$componentType = $component->name;
break;
@@ -209,7 +210,7 @@ class EventListener implements IEventListener {
$prinical = explode('/', $share['{http://owncloud.org/ns}principal']);
if ($prinical[1] === 'users') {
$users[] = $prinical[2];
- } else if ($prinical[1] === 'groups') {
+ } elseif ($prinical[1] === 'groups') {
$groups[] = $prinical[2];
}
}
diff --git a/lib/Notifier.php b/lib/Notifier.php
index 600d457..0cea996 100644
--- a/lib/Notifier.php
+++ b/lib/Notifier.php
@@ -1,4 +1,5 @@
<?php
+
declare(strict_types=1);
/**
* @copyright Copyright (c) 2018, Joas Schilling <coding@schilljs.com>
@@ -38,10 +39,9 @@ use OCP\Notification\INotification;
use OCP\Notification\INotifier;
class Notifier implements INotifier {
-
- const SUBJECT_OBJECT_ADD = 'object_add';
- const SUBJECT_OBJECT_UPDATE = 'object_update';
- const SUBJECT_OBJECT_DELETE = 'object_delete';
+ public const SUBJECT_OBJECT_ADD = 'object_add';
+ public const SUBJECT_OBJECT_UPDATE = 'object_update';
+ public const SUBJECT_OBJECT_DELETE = 'object_delete';
/** @var IFactory */
protected $languageFactory;
@@ -113,9 +113,9 @@ class Notifier implements INotifier {
if ($notification->getSubject() === self::SUBJECT_OBJECT_ADD . '_event') {
$subject = $this->l->t('{actor} created {event} in {calendar}');
- } else if ($notification->getSubject() === self::SUBJECT_OBJECT_DELETE . '_event') {
+ } elseif ($notification->getSubject() === self::SUBJECT_OBJECT_DELETE . '_event') {
$subject = $this->l->t('{actor} deleted {event} from {calendar}');
- } else if ($notification->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_event') {
+ } elseif ($notification->getSubject() === self::SUBJECT_OBJECT_UPDATE . '_event') {
$subject = $this->l->t('{actor} updated {event} in {calendar}');
} else {
throw new AlreadyProcessedException();