1
0

ICapability.php 913 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OCP\Capabilities;
  8. /**
  9. * Minimal interface that has to be implemented for a class to be considered
  10. * a capability.
  11. *
  12. * In an application use \OCP\AppFramework\Bootstrap\IRegistrationContext::registerCapability
  13. * to register capabilities.
  14. *
  15. * @since 8.2.0
  16. */
  17. interface ICapability {
  18. /**
  19. * Function an app uses to return the capabilities
  20. *
  21. * ```php
  22. * return [
  23. * 'myapp' => [
  24. * 'awesomefeature' => true,
  25. * 'featureversion' => 3,
  26. * ],
  27. * 'morecomplex' => [
  28. * 'a' => [1, 2],
  29. * ],
  30. * ];
  31. * ```
  32. *
  33. * @return array<string, array<string, mixed>> Indexed array containing the app's capabilities
  34. * @since 8.2.0
  35. */
  36. public function getCapabilities();
  37. }