diff options
Diffstat (limited to 'apps/dav/lib/Events/CalendarShareUpdatedEvent.php')
-rw-r--r-- | apps/dav/lib/Events/CalendarShareUpdatedEvent.php | 72 |
1 files changed, 20 insertions, 52 deletions
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 { |