aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Events
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib/Events')
-rw-r--r--apps/dav/lib/Events/AddressBookCreatedEvent.php35
-rw-r--r--apps/dav/lib/Events/AddressBookDeletedEvent.php41
-rw-r--r--apps/dav/lib/Events/AddressBookShareUpdatedEvent.php53
-rw-r--r--apps/dav/lib/Events/AddressBookUpdatedEvent.php47
-rw-r--r--apps/dav/lib/Events/BeforeFileDirectDownloadedEvent.php28
-rw-r--r--apps/dav/lib/Events/CachedCalendarObjectCreatedEvent.php47
-rw-r--r--apps/dav/lib/Events/CachedCalendarObjectDeletedEvent.php47
-rw-r--r--apps/dav/lib/Events/CachedCalendarObjectUpdatedEvent.php47
-rw-r--r--apps/dav/lib/Events/CalendarCreatedEvent.php35
-rw-r--r--apps/dav/lib/Events/CalendarDeletedEvent.php41
-rw-r--r--apps/dav/lib/Events/CalendarMovedToTrashEvent.php41
-rw-r--r--apps/dav/lib/Events/CalendarObjectCreatedEvent.php101
-rw-r--r--apps/dav/lib/Events/CalendarObjectDeletedEvent.php101
-rw-r--r--apps/dav/lib/Events/CalendarObjectMovedToTrashEvent.php96
-rw-r--r--apps/dav/lib/Events/CalendarObjectRestoredEvent.php96
-rw-r--r--apps/dav/lib/Events/CalendarObjectUpdatedEvent.php101
-rw-r--r--apps/dav/lib/Events/CalendarPublishedEvent.php42
-rw-r--r--apps/dav/lib/Events/CalendarRestoredEvent.php41
-rw-r--r--apps/dav/lib/Events/CalendarShareUpdatedEvent.php72
-rw-r--r--apps/dav/lib/Events/CalendarUnpublishedEvent.php36
-rw-r--r--apps/dav/lib/Events/CalendarUpdatedEvent.php47
-rw-r--r--apps/dav/lib/Events/CardCreatedEvent.php47
-rw-r--r--apps/dav/lib/Events/CardDeletedEvent.php47
-rw-r--r--apps/dav/lib/Events/CardMovedEvent.php90
-rw-r--r--apps/dav/lib/Events/CardUpdatedEvent.php47
-rw-r--r--apps/dav/lib/Events/SabrePluginAddEvent.php37
-rw-r--r--apps/dav/lib/Events/SabrePluginAuthInitEvent.php29
-rw-r--r--apps/dav/lib/Events/SubscriptionCreatedEvent.php35
-rw-r--r--apps/dav/lib/Events/SubscriptionDeletedEvent.php41
-rw-r--r--apps/dav/lib/Events/SubscriptionUpdatedEvent.php47
30 files changed, 304 insertions, 1311 deletions
diff --git a/apps/dav/lib/Events/AddressBookCreatedEvent.php b/apps/dav/lib/Events/AddressBookCreatedEvent.php
index 86c4cd23640..1a56bcbf63f 100644
--- a/apps/dav/lib/Events/AddressBookCreatedEvent.php
+++ b/apps/dav/lib/Events/AddressBookCreatedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,12 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class AddressBookCreatedEvent extends Event {
- /** @var int */
- private $addressBookId;
-
- /** @var array */
- private $addressBookData;
-
/**
* AddressBookCreatedEvent constructor.
*
@@ -48,11 +25,11 @@ class AddressBookCreatedEvent extends Event {
* @param array $addressBookData
* @since 20.0.0
*/
- public function __construct(int $addressBookId,
- array $addressBookData) {
+ public function __construct(
+ private int $addressBookId,
+ private array $addressBookData,
+ ) {
parent::__construct();
- $this->addressBookId = $addressBookId;
- $this->addressBookData = $addressBookData;
}
/**
diff --git a/apps/dav/lib/Events/AddressBookDeletedEvent.php b/apps/dav/lib/Events/AddressBookDeletedEvent.php
index 3c8da6b7bf0..b1ec4125513 100644
--- a/apps/dav/lib/Events/AddressBookDeletedEvent.php
+++ b/apps/dav/lib/Events/AddressBookDeletedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,15 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class AddressBookDeletedEvent extends Event {
- /** @var int */
- private $addressBookId;
-
- /** @var array */
- private $addressBookData;
-
- /** @var array */
- private $shares;
-
/**
* AddressBookDeletedEvent constructor.
*
@@ -52,13 +26,12 @@ class AddressBookDeletedEvent extends Event {
* @param array $shares
* @since 20.0.0
*/
- public function __construct(int $addressBookId,
- array $addressBookData,
- array $shares) {
+ public function __construct(
+ private int $addressBookId,
+ private array $addressBookData,
+ private array $shares,
+ ) {
parent::__construct();
- $this->addressBookId = $addressBookId;
- $this->addressBookData = $addressBookData;
- $this->shares = $shares;
}
/**
diff --git a/apps/dav/lib/Events/AddressBookShareUpdatedEvent.php b/apps/dav/lib/Events/AddressBookShareUpdatedEvent.php
index f9f8ff99d40..9a574fb548e 100644
--- a/apps/dav/lib/Events/AddressBookShareUpdatedEvent.php
+++ b/apps/dav/lib/Events/AddressBookShareUpdatedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,21 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class AddressBookShareUpdatedEvent extends Event {
- /** @var int */
- private $addressBookId;
-
- /** @var array */
- private $addressBookData;
-
- /** @var array */
- private $oldShares;
-
- /** @var array */
- private $added;
-
- /** @var array */
- private $removed;
-
/**
* AddressBookShareUpdatedEvent constructor.
*
@@ -60,17 +28,14 @@ class AddressBookShareUpdatedEvent extends Event {
* @param array $removed
* @since 20.0.0
*/
- public function __construct(int $addressBookId,
- array $addressBookData,
- array $oldShares,
- array $added,
- array $removed) {
+ public function __construct(
+ private int $addressBookId,
+ private array $addressBookData,
+ private array $oldShares,
+ private array $added,
+ private array $removed,
+ ) {
parent::__construct();
- $this->addressBookId = $addressBookId;
- $this->addressBookData = $addressBookData;
- $this->oldShares = $oldShares;
- $this->added = $added;
- $this->removed = $removed;
}
/**
diff --git a/apps/dav/lib/Events/AddressBookUpdatedEvent.php b/apps/dav/lib/Events/AddressBookUpdatedEvent.php
index c632f1817a8..fe6dc024cd2 100644
--- a/apps/dav/lib/Events/AddressBookUpdatedEvent.php
+++ b/apps/dav/lib/Events/AddressBookUpdatedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,18 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class AddressBookUpdatedEvent extends Event {
- /** @var int */
- private $addressBookId;
-
- /** @var array */
- private $addressBookData;
-
- /** @var array */
- private $shares;
-
- /** @var array */
- private $mutations;
-
/**
* AddressBookUpdatedEvent constructor.
*
@@ -56,15 +27,13 @@ class AddressBookUpdatedEvent extends Event {
* @param array $mutations
* @since 20.0.0
*/
- public function __construct(int $addressBookId,
- array $addressBookData,
- array $shares,
- array $mutations) {
+ public function __construct(
+ private int $addressBookId,
+ private array $addressBookData,
+ private array $shares,
+ private array $mutations,
+ ) {
parent::__construct();
- $this->addressBookId = $addressBookId;
- $this->addressBookData = $addressBookData;
- $this->shares = $shares;
- $this->mutations = $mutations;
}
/**
diff --git a/apps/dav/lib/Events/BeforeFileDirectDownloadedEvent.php b/apps/dav/lib/Events/BeforeFileDirectDownloadedEvent.php
index ddb79505ac6..a79d730e8ff 100644
--- a/apps/dav/lib/Events/BeforeFileDirectDownloadedEvent.php
+++ b/apps/dav/lib/Events/BeforeFileDirectDownloadedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2021 Robin Appelman <robin@icewind.nl>
- *
- * @author Robin Appelman <robin@icewind.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -32,11 +15,10 @@ use OCP\Files\File;
* @since 22.0.0
*/
class BeforeFileDirectDownloadedEvent extends Event {
- private $file;
-
- public function __construct(File $file) {
+ public function __construct(
+ private File $file,
+ ) {
parent::__construct();
- $this->file = $file;
}
/**
diff --git a/apps/dav/lib/Events/CachedCalendarObjectCreatedEvent.php b/apps/dav/lib/Events/CachedCalendarObjectCreatedEvent.php
index 29e11ddc146..ea1c344ed27 100644
--- a/apps/dav/lib/Events/CachedCalendarObjectCreatedEvent.php
+++ b/apps/dav/lib/Events/CachedCalendarObjectCreatedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,18 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class CachedCalendarObjectCreatedEvent extends Event {
- /** @var int */
- private $subscriptionId;
-
- /** @var array */
- private $subscriptionData;
-
- /** @var array */
- private $shares;
-
- /** @var array */
- private $objectData;
-
/**
* CachedCalendarObjectCreatedEvent constructor.
*
@@ -56,15 +27,13 @@ class CachedCalendarObjectCreatedEvent extends Event {
* @param array $objectData
* @since 20.0.0
*/
- public function __construct(int $subscriptionId,
- array $subscriptionData,
- array $shares,
- array $objectData) {
+ public function __construct(
+ private int $subscriptionId,
+ private array $subscriptionData,
+ private array $shares,
+ private array $objectData,
+ ) {
parent::__construct();
- $this->subscriptionId = $subscriptionId;
- $this->subscriptionData = $subscriptionData;
- $this->shares = $shares;
- $this->objectData = $objectData;
}
/**
diff --git a/apps/dav/lib/Events/CachedCalendarObjectDeletedEvent.php b/apps/dav/lib/Events/CachedCalendarObjectDeletedEvent.php
index eaf98df60bf..8f8e55d32e5 100644
--- a/apps/dav/lib/Events/CachedCalendarObjectDeletedEvent.php
+++ b/apps/dav/lib/Events/CachedCalendarObjectDeletedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,18 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class CachedCalendarObjectDeletedEvent extends Event {
- /** @var int */
- private $subscriptionId;
-
- /** @var array */
- private $subscriptionData;
-
- /** @var array */
- private $shares;
-
- /** @var array */
- private $objectData;
-
/**
* CachedCalendarObjectDeletedEvent constructor.
*
@@ -56,15 +27,13 @@ class CachedCalendarObjectDeletedEvent extends Event {
* @param array $objectData
* @since 20.0.0
*/
- public function __construct(int $subscriptionId,
- array $subscriptionData,
- array $shares,
- array $objectData) {
+ public function __construct(
+ private int $subscriptionId,
+ private array $subscriptionData,
+ private array $shares,
+ private array $objectData,
+ ) {
parent::__construct();
- $this->subscriptionId = $subscriptionId;
- $this->subscriptionData = $subscriptionData;
- $this->shares = $shares;
- $this->objectData = $objectData;
}
/**
diff --git a/apps/dav/lib/Events/CachedCalendarObjectUpdatedEvent.php b/apps/dav/lib/Events/CachedCalendarObjectUpdatedEvent.php
index d47d75ec1d8..0adb4164dc9 100644
--- a/apps/dav/lib/Events/CachedCalendarObjectUpdatedEvent.php
+++ b/apps/dav/lib/Events/CachedCalendarObjectUpdatedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,18 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class CachedCalendarObjectUpdatedEvent extends Event {
- /** @var int */
- private $subscriptionId;
-
- /** @var array */
- private $subscriptionData;
-
- /** @var array */
- private $shares;
-
- /** @var array */
- private $objectData;
-
/**
* CachedCalendarObjectUpdatedEvent constructor.
*
@@ -56,15 +27,13 @@ class CachedCalendarObjectUpdatedEvent extends Event {
* @param array $objectData
* @since 20.0.0
*/
- public function __construct(int $subscriptionId,
- array $subscriptionData,
- array $shares,
- array $objectData) {
+ public function __construct(
+ private int $subscriptionId,
+ private array $subscriptionData,
+ private array $shares,
+ private array $objectData,
+ ) {
parent::__construct();
- $this->subscriptionId = $subscriptionId;
- $this->subscriptionData = $subscriptionData;
- $this->shares = $shares;
- $this->objectData = $objectData;
}
/**
diff --git a/apps/dav/lib/Events/CalendarCreatedEvent.php b/apps/dav/lib/Events/CalendarCreatedEvent.php
index ba51002f829..46d1194914e 100644
--- a/apps/dav/lib/Events/CalendarCreatedEvent.php
+++ b/apps/dav/lib/Events/CalendarCreatedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,12 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class CalendarCreatedEvent extends Event {
- /** @var int */
- private $calendarId;
-
- /** @var array */
- private $calendarData;
-
/**
* CalendarCreatedEvent constructor.
*
@@ -48,11 +25,11 @@ class CalendarCreatedEvent extends Event {
* @param array $calendarData
* @since 20.0.0
*/
- public function __construct(int $calendarId,
- array $calendarData) {
+ public function __construct(
+ private int $calendarId,
+ private array $calendarData,
+ ) {
parent::__construct();
- $this->calendarId = $calendarId;
- $this->calendarData = $calendarData;
}
/**
diff --git a/apps/dav/lib/Events/CalendarDeletedEvent.php b/apps/dav/lib/Events/CalendarDeletedEvent.php
index d6207ac6ee2..c8ab4265b27 100644
--- a/apps/dav/lib/Events/CalendarDeletedEvent.php
+++ b/apps/dav/lib/Events/CalendarDeletedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,15 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class CalendarDeletedEvent extends Event {
- /** @var int */
- private $calendarId;
-
- /** @var array */
- private $calendarData;
-
- /** @var array */
- private $shares;
-
/**
* CalendarDeletedEvent constructor.
*
@@ -52,13 +26,12 @@ class CalendarDeletedEvent extends Event {
* @param array $shares
* @since 20.0.0
*/
- public function __construct(int $calendarId,
- array $calendarData,
- array $shares) {
+ public function __construct(
+ private int $calendarId,
+ private array $calendarData,
+ private array $shares,
+ ) {
parent::__construct();
- $this->calendarId = $calendarId;
- $this->calendarData = $calendarData;
- $this->shares = $shares;
}
/**
diff --git a/apps/dav/lib/Events/CalendarMovedToTrashEvent.php b/apps/dav/lib/Events/CalendarMovedToTrashEvent.php
index c04b383d5bf..8bb660a98c6 100644
--- a/apps/dav/lib/Events/CalendarMovedToTrashEvent.php
+++ b/apps/dav/lib/Events/CalendarMovedToTrashEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -32,28 +15,18 @@ use OCP\EventDispatcher\Event;
*/
class CalendarMovedToTrashEvent extends Event {
- /** @var int */
- private $calendarId;
-
- /** @var array */
- private $calendarData;
-
- /** @var array */
- private $shares;
-
/**
* @param int $calendarId
* @param array $calendarData
* @param array $shares
* @since 22.0.0
*/
- public function __construct(int $calendarId,
- array $calendarData,
- array $shares) {
+ public function __construct(
+ private int $calendarId,
+ private array $calendarData,
+ private array $shares,
+ ) {
parent::__construct();
- $this->calendarId = $calendarId;
- $this->calendarData = $calendarData;
- $this->shares = $shares;
}
/**
diff --git a/apps/dav/lib/Events/CalendarObjectCreatedEvent.php b/apps/dav/lib/Events/CalendarObjectCreatedEvent.php
deleted file mode 100644
index 294c778335e..00000000000
--- a/apps/dav/lib/Events/CalendarObjectCreatedEvent.php
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-namespace OCA\DAV\Events;
-
-use OCP\EventDispatcher\Event;
-
-/**
- * Class CalendarObjectCreatedEvent
- *
- * @package OCA\DAV\Events
- * @since 20.0.0
- */
-class CalendarObjectCreatedEvent extends Event {
-
- /** @var int */
- private $calendarId;
-
- /** @var array */
- private $calendarData;
-
- /** @var array */
- private $shares;
-
- /** @var array */
- private $objectData;
-
- /**
- * CalendarObjectCreatedEvent constructor.
- *
- * @param int $calendarId
- * @param array $calendarData
- * @param array $shares
- * @param array $objectData
- * @since 20.0.0
- */
- public function __construct(int $calendarId,
- array $calendarData,
- array $shares,
- array $objectData) {
- parent::__construct();
- $this->calendarId = $calendarId;
- $this->calendarData = $calendarData;
- $this->shares = $shares;
- $this->objectData = $objectData;
- }
-
- /**
- * @return int
- * @since 20.0.0
- */
- public function getCalendarId(): int {
- return $this->calendarId;
- }
-
- /**
- * @return array
- * @since 20.0.0
- */
- public function getCalendarData(): array {
- return $this->calendarData;
- }
-
- /**
- * @return array
- * @since 20.0.0
- */
- public function getShares(): array {
- return $this->shares;
- }
-
- /**
- * @return array
- * @since 20.0.0
- */
- public function getObjectData(): array {
- return $this->objectData;
- }
-}
diff --git a/apps/dav/lib/Events/CalendarObjectDeletedEvent.php b/apps/dav/lib/Events/CalendarObjectDeletedEvent.php
deleted file mode 100644
index 7a621994b80..00000000000
--- a/apps/dav/lib/Events/CalendarObjectDeletedEvent.php
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-namespace OCA\DAV\Events;
-
-use OCP\EventDispatcher\Event;
-
-/**
- * Class CalendarObjectDeletedEvent
- *
- * @package OCA\DAV\Events
- * @since 20.0.0
- */
-class CalendarObjectDeletedEvent extends Event {
-
- /** @var int */
- private $calendarId;
-
- /** @var array */
- private $calendarData;
-
- /** @var array */
- private $shares;
-
- /** @var array */
- private $objectData;
-
- /**
- * CalendarObjectDeletedEvent constructor.
- *
- * @param int $calendarId
- * @param array $calendarData
- * @param array $shares
- * @param array $objectData
- * @since 20.0.0
- */
- public function __construct(int $calendarId,
- array $calendarData,
- array $shares,
- array $objectData) {
- parent::__construct();
- $this->calendarId = $calendarId;
- $this->calendarData = $calendarData;
- $this->shares = $shares;
- $this->objectData = $objectData;
- }
-
- /**
- * @return int
- * @since 20.0.0
- */
- public function getCalendarId(): int {
- return $this->calendarId;
- }
-
- /**
- * @return array
- * @since 20.0.0
- */
- public function getCalendarData(): array {
- return $this->calendarData;
- }
-
- /**
- * @return array
- * @since 20.0.0
- */
- public function getShares(): array {
- return $this->shares;
- }
-
- /**
- * @return array
- * @since 20.0.0
- */
- public function getObjectData(): array {
- return $this->objectData;
- }
-}
diff --git a/apps/dav/lib/Events/CalendarObjectMovedToTrashEvent.php b/apps/dav/lib/Events/CalendarObjectMovedToTrashEvent.php
deleted file mode 100644
index d7a3b99de82..00000000000
--- a/apps/dav/lib/Events/CalendarObjectMovedToTrashEvent.php
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-namespace OCA\DAV\Events;
-
-use OCP\EventDispatcher\Event;
-
-/**
- * @since 22.0.0
- */
-class CalendarObjectMovedToTrashEvent extends Event {
-
- /** @var int */
- private $calendarId;
-
- /** @var array */
- private $calendarData;
-
- /** @var array */
- private $shares;
-
- /** @var array */
- private $objectData;
-
- /**
- * @param int $calendarId
- * @param array $calendarData
- * @param array $shares
- * @param array $objectData
- * @since 22.0.0
- */
- public function __construct(int $calendarId,
- array $calendarData,
- array $shares,
- array $objectData) {
- parent::__construct();
- $this->calendarId = $calendarId;
- $this->calendarData = $calendarData;
- $this->shares = $shares;
- $this->objectData = $objectData;
- }
-
- /**
- * @return int
- * @since 22.0.0
- */
- public function getCalendarId(): int {
- return $this->calendarId;
- }
-
- /**
- * @return array
- * @since 22.0.0
- */
- public function getCalendarData(): array {
- return $this->calendarData;
- }
-
- /**
- * @return array
- * @since 22.0.0
- */
- public function getShares(): array {
- return $this->shares;
- }
-
- /**
- * @return array
- * @since 22.0.0
- */
- public function getObjectData(): array {
- return $this->objectData;
- }
-}
diff --git a/apps/dav/lib/Events/CalendarObjectRestoredEvent.php b/apps/dav/lib/Events/CalendarObjectRestoredEvent.php
deleted file mode 100644
index 42f296e64cc..00000000000
--- a/apps/dav/lib/Events/CalendarObjectRestoredEvent.php
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-namespace OCA\DAV\Events;
-
-use OCP\EventDispatcher\Event;
-
-/**
- * @since 22.0.0
- */
-class CalendarObjectRestoredEvent extends Event {
-
- /** @var int */
- private $calendarId;
-
- /** @var array */
- private $calendarData;
-
- /** @var array */
- private $shares;
-
- /** @var array */
- private $objectData;
-
- /**
- * @param int $calendarId
- * @param array $calendarData
- * @param array $shares
- * @param array $objectData
- * @since 22.0.0
- */
- public function __construct(int $calendarId,
- array $calendarData,
- array $shares,
- array $objectData) {
- parent::__construct();
- $this->calendarId = $calendarId;
- $this->calendarData = $calendarData;
- $this->shares = $shares;
- $this->objectData = $objectData;
- }
-
- /**
- * @return int
- * @since 22.0.0
- */
- public function getCalendarId(): int {
- return $this->calendarId;
- }
-
- /**
- * @return array
- * @since 22.0.0
- */
- public function getCalendarData(): array {
- return $this->calendarData;
- }
-
- /**
- * @return array
- * @since 22.0.0
- */
- public function getShares(): array {
- return $this->shares;
- }
-
- /**
- * @return array
- * @since 22.0.0
- */
- public function getObjectData(): array {
- return $this->objectData;
- }
-}
diff --git a/apps/dav/lib/Events/CalendarObjectUpdatedEvent.php b/apps/dav/lib/Events/CalendarObjectUpdatedEvent.php
deleted file mode 100644
index 84157afd20a..00000000000
--- a/apps/dav/lib/Events/CalendarObjectUpdatedEvent.php
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-namespace OCA\DAV\Events;
-
-use OCP\EventDispatcher\Event;
-
-/**
- * Class CalendarObjectUpdatedEvent
- *
- * @package OCA\DAV\Events
- * @since 20.0.0
- */
-class CalendarObjectUpdatedEvent extends Event {
-
- /** @var int */
- private $calendarId;
-
- /** @var array */
- private $calendarData;
-
- /** @var array */
- private $shares;
-
- /** @var array */
- private $objectData;
-
- /**
- * CalendarObjectUpdatedEvent constructor.
- *
- * @param int $calendarId
- * @param array $calendarData
- * @param array $shares
- * @param array $objectData
- * @since 20.0.0
- */
- public function __construct(int $calendarId,
- array $calendarData,
- array $shares,
- array $objectData) {
- parent::__construct();
- $this->calendarId = $calendarId;
- $this->calendarData = $calendarData;
- $this->shares = $shares;
- $this->objectData = $objectData;
- }
-
- /**
- * @return int
- * @since 20.0.0
- */
- public function getCalendarId(): int {
- return $this->calendarId;
- }
-
- /**
- * @return array
- * @since 20.0.0
- */
- public function getCalendarData(): array {
- return $this->calendarData;
- }
-
- /**
- * @return array
- * @since 20.0.0
- */
- public function getShares(): array {
- return $this->shares;
- }
-
- /**
- * @return array
- * @since 20.0.0
- */
- public function getObjectData(): array {
- return $this->objectData;
- }
-}
diff --git a/apps/dav/lib/Events/CalendarPublishedEvent.php b/apps/dav/lib/Events/CalendarPublishedEvent.php
index 7b3b95f2f77..32fb1c36963 100644
--- a/apps/dav/lib/Events/CalendarPublishedEvent.php
+++ b/apps/dav/lib/Events/CalendarPublishedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -34,16 +17,6 @@ use OCP\EventDispatcher\Event;
* @since 20.0.0
*/
class CalendarPublishedEvent extends Event {
-
- /** @var int */
- private $calendarId;
-
- /** @var array */
- private $calendarData;
-
- /** @var string */
- private $publicUri;
-
/**
* CalendarPublishedEvent constructor.
*
@@ -52,13 +25,12 @@ class CalendarPublishedEvent extends Event {
* @param string $publicUri
* @since 20.0.0
*/
- public function __construct(int $calendarId,
- array $calendarData,
- string $publicUri) {
+ public function __construct(
+ private int $calendarId,
+ private array $calendarData,
+ private string $publicUri,
+ ) {
parent::__construct();
- $this->calendarId = $calendarId;
- $this->calendarData = $calendarData;
- $this->publicUri = $publicUri;
}
/**
diff --git a/apps/dav/lib/Events/CalendarRestoredEvent.php b/apps/dav/lib/Events/CalendarRestoredEvent.php
index ef477ac1d48..f404771dea2 100644
--- a/apps/dav/lib/Events/CalendarRestoredEvent.php
+++ b/apps/dav/lib/Events/CalendarRestoredEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright 2021 Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -32,28 +15,18 @@ use OCP\EventDispatcher\Event;
*/
class CalendarRestoredEvent extends Event {
- /** @var int */
- private $calendarId;
-
- /** @var array */
- private $calendarData;
-
- /** @var array */
- private $shares;
-
/**
* @param int $calendarId
* @param array $calendarData
* @param array $shares
* @since 22.0.0
*/
- public function __construct(int $calendarId,
- array $calendarData,
- array $shares) {
+ public function __construct(
+ private int $calendarId,
+ private array $calendarData,
+ private array $shares,
+ ) {
parent::__construct();
- $this->calendarId = $calendarId;
- $this->calendarData = $calendarData;
- $this->shares = $shares;
}
/**
diff --git a/apps/dav/lib/Events/CalendarShareUpdatedEvent.php b/apps/dav/lib/Events/CalendarShareUpdatedEvent.php
index a9011bc0273..0f8b23ad3ac 100644
--- a/apps/dav/lib/Events/CalendarShareUpdatedEvent.php
+++ b/apps/dav/lib/Events/CalendarShareUpdatedEvent.php
@@ -3,28 +3,12 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
+use OCA\DAV\CalDAV\CalDavBackend;
use OCP\EventDispatcher\Event;
/**
@@ -32,49 +16,32 @@ use OCP\EventDispatcher\Event;
*
* @package OCA\DAV\Events
* @since 20.0.0
+ *
+ * @psalm-import-type CalendarInfo from CalDavBackend
*/
class CalendarShareUpdatedEvent extends Event {
-
- /** @var int */
- private $calendarId;
-
- /** @var array */
- private $calendarData;
-
- /** @var array */
- private $oldShares;
-
- /** @var array */
- private $added;
-
- /** @var array */
- private $removed;
-
/**
* CalendarShareUpdatedEvent constructor.
*
* @param int $calendarId
+ * @psalm-param CalendarInfo $calendarData
* @param array $calendarData
- * @param array $oldShares
- * @param array $added
- * @param array $removed
+ * @param list<array{href: string, commonName: string, status: int, readOnly: bool, '{http://owncloud.org/ns}principal': string, '{http://owncloud.org/ns}group-share': bool}> $oldShares
+ * @param list<array{href: string, commonName: string, readOnly: bool}> $added
+ * @param list<string> $removed
* @since 20.0.0
*/
- public function __construct(int $calendarId,
- array $calendarData,
- array $oldShares,
- array $added,
- array $removed) {
+ public function __construct(
+ private int $calendarId,
+ private array $calendarData,
+ private array $oldShares,
+ private array $added,
+ private array $removed,
+ ) {
parent::__construct();
- $this->calendarId = $calendarId;
- $this->calendarData = $calendarData;
- $this->oldShares = $oldShares;
- $this->added = $added;
- $this->removed = $removed;
}
/**
- * @return int
* @since 20.0.0
*/
public function getCalendarId(): int {
@@ -82,6 +49,7 @@ class CalendarShareUpdatedEvent extends Event {
}
/**
+ * @psalm-return CalendarInfo
* @return array
* @since 20.0.0
*/
@@ -90,7 +58,7 @@ class CalendarShareUpdatedEvent extends Event {
}
/**
- * @return array
+ * @return list<array{href: string, commonName: string, status: int, readOnly: bool, '{http://owncloud.org/ns}principal': string, '{http://owncloud.org/ns}group-share': bool}>
* @since 20.0.0
*/
public function getOldShares(): array {
@@ -98,7 +66,7 @@ class CalendarShareUpdatedEvent extends Event {
}
/**
- * @return array
+ * @return list<array{href: string, commonName: string, readOnly: bool}>
* @since 20.0.0
*/
public function getAdded(): array {
@@ -106,7 +74,7 @@ class CalendarShareUpdatedEvent extends Event {
}
/**
- * @return array
+ * @return list<string>
* @since 20.0.0
*/
public function getRemoved(): array {
diff --git a/apps/dav/lib/Events/CalendarUnpublishedEvent.php b/apps/dav/lib/Events/CalendarUnpublishedEvent.php
index 0cea53c6f0d..10d1712686d 100644
--- a/apps/dav/lib/Events/CalendarUnpublishedEvent.php
+++ b/apps/dav/lib/Events/CalendarUnpublishedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -34,13 +17,6 @@ use OCP\EventDispatcher\Event;
* @since 20.0.0
*/
class CalendarUnpublishedEvent extends Event {
-
- /** @var int */
- private $calendarId;
-
- /** @var array */
- private $calendarData;
-
/**
* CalendarUnpublishedEvent constructor.
*
@@ -48,11 +24,11 @@ class CalendarUnpublishedEvent extends Event {
* @param array $calendarData
* @since 20.0.0
*/
- public function __construct(int $calendarId,
- array $calendarData) {
+ public function __construct(
+ private int $calendarId,
+ private array $calendarData,
+ ) {
parent::__construct();
- $this->calendarId = $calendarId;
- $this->calendarData = $calendarData;
}
/**
diff --git a/apps/dav/lib/Events/CalendarUpdatedEvent.php b/apps/dav/lib/Events/CalendarUpdatedEvent.php
index ec33412b478..a603d3152f0 100644
--- a/apps/dav/lib/Events/CalendarUpdatedEvent.php
+++ b/apps/dav/lib/Events/CalendarUpdatedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,18 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class CalendarUpdatedEvent extends Event {
- /** @var int */
- private $calendarId;
-
- /** @var array */
- private $calendarData;
-
- /** @var array */
- private $shares;
-
- /** @var array */
- private $mutations;
-
/**
* CalendarUpdatedEvent constructor.
*
@@ -56,15 +27,13 @@ class CalendarUpdatedEvent extends Event {
* @param array $mutations
* @since 20.0.0
*/
- public function __construct(int $calendarId,
- array $calendarData,
- array $shares,
- array $mutations) {
+ public function __construct(
+ private int $calendarId,
+ private array $calendarData,
+ private array $shares,
+ private array $mutations,
+ ) {
parent::__construct();
- $this->calendarId = $calendarId;
- $this->calendarData = $calendarData;
- $this->shares = $shares;
- $this->mutations = $mutations;
}
/**
diff --git a/apps/dav/lib/Events/CardCreatedEvent.php b/apps/dav/lib/Events/CardCreatedEvent.php
index 4c6b1714721..5a66d73e707 100644
--- a/apps/dav/lib/Events/CardCreatedEvent.php
+++ b/apps/dav/lib/Events/CardCreatedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,18 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class CardCreatedEvent extends Event {
- /** @var int */
- private $addressBookId;
-
- /** @var array */
- private $addressBookData;
-
- /** @var array */
- private $shares;
-
- /** @var array */
- private $cardData;
-
/**
* CardCreatedEvent constructor.
*
@@ -56,15 +27,13 @@ class CardCreatedEvent extends Event {
* @param array $cardData
* @since 20.0.0
*/
- public function __construct(int $addressBookId,
- array $addressBookData,
- array $shares,
- array $cardData) {
+ public function __construct(
+ private int $addressBookId,
+ private array $addressBookData,
+ private array $shares,
+ private array $cardData,
+ ) {
parent::__construct();
- $this->addressBookId = $addressBookId;
- $this->addressBookData = $addressBookData;
- $this->shares = $shares;
- $this->cardData = $cardData;
}
/**
diff --git a/apps/dav/lib/Events/CardDeletedEvent.php b/apps/dav/lib/Events/CardDeletedEvent.php
index f4d7e21fab1..237ffa7d623 100644
--- a/apps/dav/lib/Events/CardDeletedEvent.php
+++ b/apps/dav/lib/Events/CardDeletedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,18 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class CardDeletedEvent extends Event {
- /** @var int */
- private $addressBookId;
-
- /** @var array */
- private $addressBookData;
-
- /** @var array */
- private $shares;
-
- /** @var array */
- private $cardData;
-
/**
* CardDeletedEvent constructor.
*
@@ -56,15 +27,13 @@ class CardDeletedEvent extends Event {
* @param array $cardData
* @since 20.0.0
*/
- public function __construct(int $addressBookId,
- array $addressBookData,
- array $shares,
- array $cardData) {
+ public function __construct(
+ private int $addressBookId,
+ private array $addressBookData,
+ private array $shares,
+ private array $cardData,
+ ) {
parent::__construct();
- $this->addressBookId = $addressBookId;
- $this->addressBookData = $addressBookData;
- $this->shares = $shares;
- $this->cardData = $cardData;
}
/**
diff --git a/apps/dav/lib/Events/CardMovedEvent.php b/apps/dav/lib/Events/CardMovedEvent.php
new file mode 100644
index 00000000000..be69a046537
--- /dev/null
+++ b/apps/dav/lib/Events/CardMovedEvent.php
@@ -0,0 +1,90 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCA\DAV\Events;
+
+use OCP\EventDispatcher\Event;
+
+/**
+ * Class CardMovedEvent
+ *
+ * @package OCA\DAV\Events
+ * @since 27.0.0
+ */
+class CardMovedEvent extends Event {
+ /**
+ * @since 27.0.0
+ */
+ public function __construct(
+ private int $sourceAddressBookId,
+ private array $sourceAddressBookData,
+ private int $targetAddressBookId,
+ private array $targetAddressBookData,
+ private array $sourceShares,
+ private array $targetShares,
+ private array $objectData,
+ ) {
+ parent::__construct();
+ }
+
+ /**
+ * @return int
+ * @since 27.0.0
+ */
+ public function getSourceAddressBookId(): int {
+ return $this->sourceAddressBookId;
+ }
+
+ /**
+ * @return array
+ * @since 27.0.0
+ */
+ public function getSourceAddressBookData(): array {
+ return $this->sourceAddressBookData;
+ }
+
+ /**
+ * @return int
+ * @since 27.0.0
+ */
+ public function getTargetAddressBookId(): int {
+ return $this->targetAddressBookId;
+ }
+
+ /**
+ * @return array
+ * @since 27.0.0
+ */
+ public function getTargetAddressBookData(): array {
+ return $this->targetAddressBookData;
+ }
+
+ /**
+ * @return array
+ * @since 27.0.0
+ */
+ public function getSourceShares(): array {
+ return $this->sourceShares;
+ }
+
+ /**
+ * @return array
+ * @since 27.0.0
+ */
+ public function getTargetShares(): array {
+ return $this->targetShares;
+ }
+
+ /**
+ * @return array
+ * @since 27.0.0
+ */
+ public function getObjectData(): array {
+ return $this->objectData;
+ }
+}
diff --git a/apps/dav/lib/Events/CardUpdatedEvent.php b/apps/dav/lib/Events/CardUpdatedEvent.php
index 213419d51a3..10fc5b74594 100644
--- a/apps/dav/lib/Events/CardUpdatedEvent.php
+++ b/apps/dav/lib/Events/CardUpdatedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,18 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class CardUpdatedEvent extends Event {
- /** @var int */
- private $addressBookId;
-
- /** @var array */
- private $addressBookData;
-
- /** @var array */
- private $shares;
-
- /** @var array */
- private $cardData;
-
/**
* CardUpdatedEvent constructor.
*
@@ -56,15 +27,13 @@ class CardUpdatedEvent extends Event {
* @param array $cardData
* @since 20.0.0
*/
- public function __construct(int $addressBookId,
- array $addressBookData,
- array $shares,
- array $cardData) {
+ public function __construct(
+ private int $addressBookId,
+ private array $addressBookData,
+ private array $shares,
+ private array $cardData,
+ ) {
parent::__construct();
- $this->addressBookId = $addressBookId;
- $this->addressBookData = $addressBookData;
- $this->shares = $shares;
- $this->cardData = $cardData;
}
/**
diff --git a/apps/dav/lib/Events/SabrePluginAddEvent.php b/apps/dav/lib/Events/SabrePluginAddEvent.php
new file mode 100644
index 00000000000..866fae2e224
--- /dev/null
+++ b/apps/dav/lib/Events/SabrePluginAddEvent.php
@@ -0,0 +1,37 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCA\DAV\Events;
+
+use OCP\EventDispatcher\Event;
+use Sabre\DAV\Server;
+
+/**
+ * This event is triggered during the setup of the SabreDAV server to allow the
+ * registration of additional plugins.
+ *
+ * @since 28.0.0
+ */
+class SabrePluginAddEvent extends Event {
+
+ /**
+ * @since 28.0.0
+ */
+ public function __construct(
+ private Server $server,
+ ) {
+ parent::__construct();
+ }
+
+ /**
+ * @since 28.0.0
+ */
+ public function getServer(): Server {
+ return $this->server;
+ }
+}
diff --git a/apps/dav/lib/Events/SabrePluginAuthInitEvent.php b/apps/dav/lib/Events/SabrePluginAuthInitEvent.php
index ea1bd95a0f7..d3d93770c74 100644
--- a/apps/dav/lib/Events/SabrePluginAuthInitEvent.php
+++ b/apps/dav/lib/Events/SabrePluginAuthInitEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Morris Jobke <hey@morrisjobke.de>
- *
- * @author Morris Jobke <hey@morrisjobke.de>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -36,14 +19,12 @@ use Sabre\DAV\Server;
*/
class SabrePluginAuthInitEvent extends Event {
- /** @var Server */
- private $server;
-
/**
* @since 20.0.0
*/
- public function __construct(Server $server) {
- $this->server = $server;
+ public function __construct(
+ private Server $server,
+ ) {
}
/**
diff --git a/apps/dav/lib/Events/SubscriptionCreatedEvent.php b/apps/dav/lib/Events/SubscriptionCreatedEvent.php
index f7fc2101221..433b6db59b0 100644
--- a/apps/dav/lib/Events/SubscriptionCreatedEvent.php
+++ b/apps/dav/lib/Events/SubscriptionCreatedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,12 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class SubscriptionCreatedEvent extends Event {
- /** @var int */
- private $subscriptionId;
-
- /** @var array */
- private $subscriptionData;
-
/**
* SubscriptionCreatedEvent constructor.
*
@@ -48,11 +25,11 @@ class SubscriptionCreatedEvent extends Event {
* @param array $subscriptionData
* @since 20.0.0
*/
- public function __construct(int $subscriptionId,
- array $subscriptionData) {
+ public function __construct(
+ private int $subscriptionId,
+ private array $subscriptionData,
+ ) {
parent::__construct();
- $this->subscriptionId = $subscriptionId;
- $this->subscriptionData = $subscriptionData;
}
/**
diff --git a/apps/dav/lib/Events/SubscriptionDeletedEvent.php b/apps/dav/lib/Events/SubscriptionDeletedEvent.php
index fc31005ac0f..58d47ae98a4 100644
--- a/apps/dav/lib/Events/SubscriptionDeletedEvent.php
+++ b/apps/dav/lib/Events/SubscriptionDeletedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,15 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class SubscriptionDeletedEvent extends Event {
- /** @var int */
- private $subscriptionId;
-
- /** @var array */
- private $subscriptionData;
-
- /** @var array */
- private $shares;
-
/**
* SubscriptionDeletedEvent constructor.
*
@@ -52,13 +26,12 @@ class SubscriptionDeletedEvent extends Event {
* @param array $shares
* @since 20.0.0
*/
- public function __construct(int $subscriptionId,
- array $subscriptionData,
- array $shares) {
+ public function __construct(
+ private int $subscriptionId,
+ private array $subscriptionData,
+ private array $shares,
+ ) {
parent::__construct();
- $this->subscriptionId = $subscriptionId;
- $this->subscriptionData = $subscriptionData;
- $this->shares = $shares;
}
/**
diff --git a/apps/dav/lib/Events/SubscriptionUpdatedEvent.php b/apps/dav/lib/Events/SubscriptionUpdatedEvent.php
index 29231d13a7f..1a1b2804663 100644
--- a/apps/dav/lib/Events/SubscriptionUpdatedEvent.php
+++ b/apps/dav/lib/Events/SubscriptionUpdatedEvent.php
@@ -3,25 +3,8 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020, Georg Ehrke
- *
- * @author Georg Ehrke <oc.list@georgehrke.com>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\DAV\Events;
@@ -35,18 +18,6 @@ use OCP\EventDispatcher\Event;
*/
class SubscriptionUpdatedEvent extends Event {
- /** @var int */
- private $subscriptionId;
-
- /** @var array */
- private $subscriptionData;
-
- /** @var array */
- private $shares;
-
- /** @var array */
- private $mutations;
-
/**
* SubscriptionUpdatedEvent constructor.
*
@@ -56,15 +27,13 @@ class SubscriptionUpdatedEvent extends Event {
* @param array $mutations
* @since 20.0.0
*/
- public function __construct(int $subscriptionId,
- array $subscriptionData,
- array $shares,
- array $mutations) {
+ public function __construct(
+ private int $subscriptionId,
+ private array $subscriptionData,
+ private array $shares,
+ private array $mutations,
+ ) {
parent::__construct();
- $this->subscriptionId = $subscriptionId;
- $this->subscriptionData = $subscriptionData;
- $this->shares = $shares;
- $this->mutations = $mutations;
}
/**