aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/AppFramework/Attribute/ExceptionalImplementable.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/AppFramework/Attribute/ExceptionalImplementable.php')
-rw-r--r--lib/public/AppFramework/Attribute/ExceptionalImplementable.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/public/AppFramework/Attribute/ExceptionalImplementable.php b/lib/public/AppFramework/Attribute/ExceptionalImplementable.php
new file mode 100644
index 00000000000..23e9f830d9b
--- /dev/null
+++ b/lib/public/AppFramework/Attribute/ExceptionalImplementable.php
@@ -0,0 +1,38 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCP\AppFramework\Attribute;
+
+use Attribute;
+
+/**
+ * Attribute to declare that the API marked as Consumable/Listenable/Catchable
+ * has an exception and is Implementable/Dispatchable/Throwable by a dedicated
+ * app. Changes to such an API have to be communicated to the affected app maintainers.
+ *
+ * @since 32.0.0
+ */
+#[Attribute(Attribute::TARGET_ALL | Attribute::IS_REPEATABLE)]
+#[Consumable(since: '32.0.0')]
+#[Implementable(since: '32.0.0')]
+class ExceptionalImplementable {
+ public function __construct(
+ protected string $app,
+ protected ?string $class = null,
+ ) {
+ }
+
+ public function getApp(): string {
+ return $this->app;
+ }
+
+ public function getClass(): ?string {
+ return $this->class;
+ }
+}