diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2023-08-04 10:39:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-04 10:39:57 +0200 |
commit | 44b4c16a091592203df51c19d0be1b520bc3ad9b (patch) | |
tree | 25ee31ab54832dc2bc984f4f91940c30dcb8ac33 /lib/public | |
parent | f8bd676154f988ef2130ccb0e29b0cc95e42a204 (diff) | |
parent | 3962cd0aa8ab7530deffa3b41cab2e11a01fd14a (diff) | |
download | nextcloud-server-44b4c16a091592203df51c19d0be1b520bc3ad9b.tar.gz nextcloud-server-44b4c16a091592203df51c19d0be1b520bc3ad9b.zip |
Merge pull request #39605 from nextcloud/bugfix/noid/final-events-cleanup
fix!: Final round of moving to IEventDispatcher
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/Accounts/UserUpdatedEvent.php | 58 | ||||
-rw-r--r-- | lib/public/Files/Events/NodeAddedToFavorite.php | 66 | ||||
-rw-r--r-- | lib/public/Files/Events/NodeRemovedFromFavorite.php | 66 | ||||
-rw-r--r-- | lib/public/IServerContainer.php | 10 | ||||
-rw-r--r-- | lib/public/Share/Events/BeforeShareCreatedEvent.php | 66 | ||||
-rw-r--r-- | lib/public/Share/Events/BeforeShareDeletedEvent.php | 50 | ||||
-rw-r--r-- | lib/public/Share/Events/ShareAcceptedEvent.php | 50 | ||||
-rw-r--r-- | lib/public/Share/Events/ShareDeletedFromSelfEvent.php | 50 | ||||
-rw-r--r-- | lib/public/User/Events/UserFirstTimeLoggedInEvent.php | 50 |
9 files changed, 456 insertions, 10 deletions
diff --git a/lib/public/Accounts/UserUpdatedEvent.php b/lib/public/Accounts/UserUpdatedEvent.php new file mode 100644 index 00000000000..e6c73f1d1c1 --- /dev/null +++ b/lib/public/Accounts/UserUpdatedEvent.php @@ -0,0 +1,58 @@ +<?php + +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/>. + * + */ +namespace OCP\Accounts; + +use OCP\EventDispatcher\Event; +use OCP\IUser; + +/** + * @since 28.0.0 + */ +class UserUpdatedEvent extends Event { + /** + * @since 28.0.0 + */ + public function __construct( + protected IUser $user, + protected array $data, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getUser(): IUser { + return $this->user; + } + + /** + * @since 28.0.0 + */ + public function getData(): array { + return $this->data; + } +} diff --git a/lib/public/Files/Events/NodeAddedToFavorite.php b/lib/public/Files/Events/NodeAddedToFavorite.php new file mode 100644 index 00000000000..d3f84582e46 --- /dev/null +++ b/lib/public/Files/Events/NodeAddedToFavorite.php @@ -0,0 +1,66 @@ +<?php + +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/>. + * + */ +namespace OCP\Files\Events; + +use OCP\EventDispatcher\Event; +use OCP\IUser; + +/** + * @since 28.0.0 + */ +class NodeAddedToFavorite extends Event { + /** + * @since 28.0.0 + */ + public function __construct( + protected IUser $user, + protected int $fileId, + protected string $path, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getUser(): IUser { + return $this->user; + } + + /** + * @since 28.0.0 + */ + public function getFileId(): int { + return $this->fileId; + } + + /** + * @since 28.0.0 + */ + public function getPath(): string { + return $this->path; + } +} diff --git a/lib/public/Files/Events/NodeRemovedFromFavorite.php b/lib/public/Files/Events/NodeRemovedFromFavorite.php new file mode 100644 index 00000000000..72b43558bec --- /dev/null +++ b/lib/public/Files/Events/NodeRemovedFromFavorite.php @@ -0,0 +1,66 @@ +<?php + +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/>. + * + */ +namespace OCP\Files\Events; + +use OCP\EventDispatcher\Event; +use OCP\IUser; + +/** + * @since 28.0.0 + */ +class NodeRemovedFromFavorite extends Event { + /** + * @since 28.0.0 + */ + public function __construct( + protected IUser $user, + protected int $fileId, + protected string $path, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getUser(): IUser { + return $this->user; + } + + /** + * @since 28.0.0 + */ + public function getFileId(): int { + return $this->fileId; + } + + /** + * @since 28.0.0 + */ + public function getPath(): string { + return $this->path; + } +} diff --git a/lib/public/IServerContainer.php b/lib/public/IServerContainer.php index f438838b98e..b66e1ecdf02 100644 --- a/lib/public/IServerContainer.php +++ b/lib/public/IServerContainer.php @@ -46,7 +46,6 @@ use OCP\Federation\ICloudFederationProviderManager; use OCP\Log\ILogFactory; use OCP\Security\IContentSecurityPolicyManager; use Psr\Container\ContainerInterface; -use Symfony\Component\EventDispatcher\EventDispatcherInterface; /** * This is a tagging interface for the server container @@ -517,15 +516,6 @@ interface IServerContainer extends ContainerInterface, IContainer { public function getMimeTypeLoader(); /** - * Get the EventDispatcher - * - * @return EventDispatcherInterface - * @deprecated 20.0.0 use \OCP\EventDispatcher\IEventDispatcher - * @since 8.2.0 - */ - public function getEventDispatcher(); - - /** * Get the Notification Manager * * @return \OCP\Notification\IManager diff --git a/lib/public/Share/Events/BeforeShareCreatedEvent.php b/lib/public/Share/Events/BeforeShareCreatedEvent.php new file mode 100644 index 00000000000..f69049b3e8d --- /dev/null +++ b/lib/public/Share/Events/BeforeShareCreatedEvent.php @@ -0,0 +1,66 @@ +<?php + +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/>. + * + */ +namespace OCP\Share\Events; + +use OCP\EventDispatcher\Event; +use OCP\Share\IShare; + +/** + * @since 28.0.0 + */ +class BeforeShareCreatedEvent extends Event { + private ?string $error = null; + + /** + * @since 28.0.0 + */ + public function __construct( + private IShare $share, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getShare(): IShare { + return $this->share; + } + + /** + * @since 28.0.0 + */ + public function setError(string $error): void { + $this->error = $error; + } + + /** + * @since 28.0.0 + */ + public function getError(): ?string { + return $this->error; + } +} diff --git a/lib/public/Share/Events/BeforeShareDeletedEvent.php b/lib/public/Share/Events/BeforeShareDeletedEvent.php new file mode 100644 index 00000000000..854d8d95b8d --- /dev/null +++ b/lib/public/Share/Events/BeforeShareDeletedEvent.php @@ -0,0 +1,50 @@ +<?php + +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/>. + * + */ +namespace OCP\Share\Events; + +use OCP\EventDispatcher\Event; +use OCP\Share\IShare; + +/** + * @since 28.0.0 + */ +class BeforeShareDeletedEvent extends Event { + /** + * @since 28.0.0 + */ + public function __construct( + private IShare $share, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getShare(): IShare { + return $this->share; + } +} diff --git a/lib/public/Share/Events/ShareAcceptedEvent.php b/lib/public/Share/Events/ShareAcceptedEvent.php new file mode 100644 index 00000000000..bf2b8084d8e --- /dev/null +++ b/lib/public/Share/Events/ShareAcceptedEvent.php @@ -0,0 +1,50 @@ +<?php + +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/>. + * + */ +namespace OCP\Share\Events; + +use OCP\EventDispatcher\Event; +use OCP\Share\IShare; + +/** + * @since 28.0.0 + */ +class ShareAcceptedEvent extends Event { + /** + * @since 28.0.0 + */ + public function __construct( + private IShare $share, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getShare(): IShare { + return $this->share; + } +} diff --git a/lib/public/Share/Events/ShareDeletedFromSelfEvent.php b/lib/public/Share/Events/ShareDeletedFromSelfEvent.php new file mode 100644 index 00000000000..0bcc7e8cf73 --- /dev/null +++ b/lib/public/Share/Events/ShareDeletedFromSelfEvent.php @@ -0,0 +1,50 @@ +<?php + +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/>. + * + */ +namespace OCP\Share\Events; + +use OCP\EventDispatcher\Event; +use OCP\Share\IShare; + +/** + * @since 28.0.0 + */ +class ShareDeletedFromSelfEvent extends Event { + /** + * @since 28.0.0 + */ + public function __construct( + private IShare $share, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getShare(): IShare { + return $this->share; + } +} diff --git a/lib/public/User/Events/UserFirstTimeLoggedInEvent.php b/lib/public/User/Events/UserFirstTimeLoggedInEvent.php new file mode 100644 index 00000000000..06491f79109 --- /dev/null +++ b/lib/public/User/Events/UserFirstTimeLoggedInEvent.php @@ -0,0 +1,50 @@ +<?php + +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/>. + * + */ +namespace OCP\User\Events; + +use OCP\EventDispatcher\Event; +use OCP\IUser; + +/** + * @since 28.0.0 + */ +class UserFirstTimeLoggedInEvent extends Event { + /** + * @since 28.0.0 + */ + public function __construct( + private IUser $user, + ) { + parent::__construct(); + } + + /** + * @since 28.0.0 + */ + public function getUser(): IUser { + return $this->user; + } +} |