aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Share
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-07-27 22:25:26 +0200
committerJoas Schilling <coding@schilljs.com>2023-07-28 14:11:20 +0200
commit8ad94cbfda58c28dacaa391390033854abdfc8b3 (patch)
treeb6a7f2a3a986f2318335c4193e1de07564eb1d62 /lib/public/Share
parent44b810bfbd83fc6eb95a67430894dbd2cf6eb339 (diff)
downloadnextcloud-server-8ad94cbfda58c28dacaa391390033854abdfc8b3.tar.gz
nextcloud-server-8ad94cbfda58c28dacaa391390033854abdfc8b3.zip
feat!: Migrate unShare events to typed events
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/public/Share')
-rw-r--r--lib/public/Share/Events/BeforeShareDeletedEvent.php50
-rw-r--r--lib/public/Share/Events/ShareDeletedFromSelfEvent.php50
2 files changed, 100 insertions, 0 deletions
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/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;
+ }
+}