diff options
Diffstat (limited to 'apps/dav/lib/Events')
31 files changed, 189 insertions, 1483 deletions
diff --git a/apps/dav/lib/Events/AddressBookCreatedEvent.php b/apps/dav/lib/Events/AddressBookCreatedEvent.php index 396c246289c..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 79785f5f0fa..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 da3c2701abd..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 d651e569467..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 64d9b6dd2c7..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 183e8e8bcf9..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 62781483def..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 649a242a1d2..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 97d522cde7c..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 5fb2f48a75c..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 123f7fc229f..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 8c5834ff050..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/CalendarObjectMovedEvent.php b/apps/dav/lib/Events/CalendarObjectMovedEvent.php deleted file mode 100644 index 402a9adf979..00000000000 --- a/apps/dav/lib/Events/CalendarObjectMovedEvent.php +++ /dev/null @@ -1,120 +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 CalendarObjectMovedEvent - * - * @package OCA\DAV\Events - * @since 25.0.0 - */ -class CalendarObjectMovedEvent extends Event { - private int $sourceCalendarId; - private array $sourceCalendarData; - private int $targetCalendarId; - private array $targetCalendarData; - private array $sourceShares; - private array $targetShares; - private array $objectData; - - /** - * @since 25.0.0 - */ - public function __construct(int $sourceCalendarId, - array $sourceCalendarData, - int $targetCalendarId, - array $targetCalendarData, - array $sourceShares, - array $targetShares, - array $objectData) { - parent::__construct(); - $this->sourceCalendarId = $sourceCalendarId; - $this->sourceCalendarData = $sourceCalendarData; - $this->targetCalendarId = $targetCalendarId; - $this->targetCalendarData = $targetCalendarData; - $this->sourceShares = $sourceShares; - $this->targetShares = $targetShares; - $this->objectData = $objectData; - } - - /** - * @return int - * @since 25.0.0 - */ - public function getSourceCalendarId(): int { - return $this->sourceCalendarId; - } - - /** - * @return array - * @since 25.0.0 - */ - public function getSourceCalendarData(): array { - return $this->sourceCalendarData; - } - - /** - * @return int - * @since 25.0.0 - */ - public function getTargetCalendarId(): int { - return $this->targetCalendarId; - } - - /** - * @return array - * @since 25.0.0 - */ - public function getTargetCalendarData(): array { - return $this->targetCalendarData; - } - - /** - * @return array - * @since 25.0.0 - */ - public function getSourceShares(): array { - return $this->sourceShares; - } - - /** - * @return array - * @since 25.0.0 - */ - public function getTargetShares(): array { - return $this->targetShares; - } - - /** - * @return array - * @since 25.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 b963d1321a4..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 76589725986..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 45d66370137..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 b92d17901f7..32fb1c36963 100644 --- a/apps/dav/lib/Events/CalendarPublishedEvent.php +++ b/apps/dav/lib/Events/CalendarPublishedEvent.php @@ -3,26 +3,8 @@ declare(strict_types=1); /** - * @copyright Copyright (c) 2020, Georg Ehrke - * - * @author Georg Ehrke <oc.list@georgehrke.com> - * @author Thomas Citharel <nextcloud@tcit.fr> - * - * @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,10 +17,6 @@ use OCP\EventDispatcher\Event; * @since 20.0.0 */ class CalendarPublishedEvent extends Event { - private int $calendarId; - private array $calendarData; - private string $publicUri; - /** * CalendarPublishedEvent constructor. * @@ -47,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 b44b3607969..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 ebde62a8be2..0f8b23ad3ac 100644 --- a/apps/dav/lib/Events/CalendarShareUpdatedEvent.php +++ b/apps/dav/lib/Events/CalendarShareUpdatedEvent.php @@ -3,74 +3,42 @@ 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; -use Sabre\CalDAV\Xml\Property\ScheduleCalendarTransp; -use Sabre\CalDAV\Xml\Property\SupportedCalendarComponentSet; /** * Class CalendarShareUpdatedEvent * * @package OCA\DAV\Events * @since 20.0.0 + * + * @psalm-import-type CalendarInfo from CalDavBackend */ class CalendarShareUpdatedEvent extends Event { - private int $calendarId; - - /** @var array{id: int, uri: string, '{http://calendarserver.org/ns/}getctag': string, '{http://sabredav.org/ns}sync-token': int, '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set': SupportedCalendarComponentSet, '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp': ScheduleCalendarTransp, '{urn:ietf:params:xml:ns:caldav}calendar-timezone': ?string } */ - private array $calendarData; - - /** @var list<array{href: string, commonName: string, status: int, readOnly: bool, '{http://owncloud.org/ns}principal': string, '{http://owncloud.org/ns}group-share': bool}> */ - private array $oldShares; - - /** @var list<array{href: string, commonName: string, readOnly: bool}> */ - private array $added; - - /** @var list<string> */ - private array $removed; - /** * CalendarShareUpdatedEvent constructor. * * @param int $calendarId - * @param array{id: int, uri: string, '{http://calendarserver.org/ns/}getctag': string, '{http://sabredav.org/ns}sync-token': int, '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set': SupportedCalendarComponentSet, '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp': ScheduleCalendarTransp, '{urn:ietf:params:xml:ns:caldav}calendar-timezone': ?string } $calendarData + * @psalm-param CalendarInfo $calendarData + * @param array $calendarData * @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; } /** @@ -81,7 +49,8 @@ class CalendarShareUpdatedEvent extends Event { } /** - * @return array{id: int, uri: string, '{http://calendarserver.org/ns/}getctag': string, '{http://sabredav.org/ns}sync-token': int, '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set': SupportedCalendarComponentSet, '{urn:ietf:params:xml:ns:caldav}schedule-calendar-transp': ScheduleCalendarTransp, '{urn:ietf:params:xml:ns:caldav}calendar-timezone': ?string } + * @psalm-return CalendarInfo + * @return array * @since 20.0.0 */ public function getCalendarData(): array { diff --git a/apps/dav/lib/Events/CalendarUnpublishedEvent.php b/apps/dav/lib/Events/CalendarUnpublishedEvent.php index ede60aeb904..10d1712686d 100644 --- a/apps/dav/lib/Events/CalendarUnpublishedEvent.php +++ b/apps/dav/lib/Events/CalendarUnpublishedEvent.php @@ -3,26 +3,8 @@ declare(strict_types=1); /** - * @copyright Copyright (c) 2020, Georg Ehrke - * - * @author Georg Ehrke <oc.list@georgehrke.com> - * @author Thomas Citharel <nextcloud@tcit.fr> - * - * @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,9 +17,6 @@ use OCP\EventDispatcher\Event; * @since 20.0.0 */ class CalendarUnpublishedEvent extends Event { - private int $calendarId; - private array $calendarData; - /** * CalendarUnpublishedEvent constructor. * @@ -45,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 c39d22b281c..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 138cccd6862..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 e0a92a2076a..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 index 38a66ed08b6..be69a046537 100644 --- a/apps/dav/lib/Events/CardMovedEvent.php +++ b/apps/dav/lib/Events/CardMovedEvent.php @@ -3,25 +3,8 @@ declare(strict_types=1); /** - * @copyright Copyright (c) 2023, Thomas Citharel <nextcloud@tcit.fr> - * - * @author Thomas Citharel <nextcloud@tcit.fr> - * - * @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: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace OCA\DAV\Events; @@ -34,32 +17,19 @@ use OCP\EventDispatcher\Event; * @since 27.0.0 */ class CardMovedEvent extends Event { - private int $sourceAddressBookId; - private array $sourceAddressBookData; - private int $targetAddressBookId; - private array $targetAddressBookData; - private array $sourceShares; - private array $targetShares; - private array $objectData; - /** * @since 27.0.0 */ - public function __construct(int $sourceAddressBookId, - array $sourceAddressBookData, - int $targetAddressBookId, - array $targetAddressBookData, - array $sourceShares, - array $targetShares, - array $objectData) { + 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(); - $this->sourceAddressBookId = $sourceAddressBookId; - $this->sourceAddressBookData = $sourceAddressBookData; - $this->targetAddressBookId = $targetAddressBookId; - $this->targetAddressBookData = $targetAddressBookData; - $this->sourceShares = $sourceShares; - $this->targetShares = $targetShares; - $this->objectData = $objectData; } /** diff --git a/apps/dav/lib/Events/CardUpdatedEvent.php b/apps/dav/lib/Events/CardUpdatedEvent.php index 40f28713ce6..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 index 3bff756e2a1..866fae2e224 100644 --- a/apps/dav/lib/Events/SabrePluginAddEvent.php +++ b/apps/dav/lib/Events/SabrePluginAddEvent.php @@ -3,25 +3,8 @@ declare(strict_types=1); /** - * @copyright Copyright (c) 2023, Joas Schilling <coding@schilljs.com> - * - * @author Joas Schilling <coding@schilljs.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: 2023 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later */ namespace OCA\DAV\Events; @@ -36,15 +19,13 @@ use Sabre\DAV\Server; */ class SabrePluginAddEvent extends Event { - /** @var Server */ - private $server; - /** * @since 28.0.0 */ - public function __construct(Server $server) { + public function __construct( + private Server $server, + ) { parent::__construct(); - $this->server = $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 9932e70c4c8..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 8aa36f4584b..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 eb90177a00d..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; } /** |