aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/AppFramework/Attribute/ExceptionalImplementable.php
blob: 23e9f830d9bed26fd48aa5ad889e6ee102e26c2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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;
	}
}