diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2023-07-03 11:29:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-03 11:29:58 +0200 |
commit | 67709b390a74f75f107445d7ad0d6742e1e5896b (patch) | |
tree | 247ebabe7b560ded1a079593bfd8daea69c55e8c /lib | |
parent | 1d5beb368862020b49fe1cc840e9b1c7eb3f6931 (diff) | |
parent | 19499964d04a185380efbccd72daa5a924ae87c7 (diff) | |
download | nextcloud-server-67709b390a74f75f107445d7ad0d6742e1e5896b.tar.gz nextcloud-server-67709b390a74f75f107445d7ad0d6742e1e5896b.zip |
Merge pull request #39057 from nextcloud/feat/ocp/type-icapabilities
feat(ocp): More specific type for ICapabilities::getCapabilities
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/OCS/CoreCapabilities.php | 2 | ||||
-rw-r--r-- | lib/public/Capabilities/ICapability.php | 21 |
2 files changed, 15 insertions, 8 deletions
diff --git a/lib/private/OCS/CoreCapabilities.php b/lib/private/OCS/CoreCapabilities.php index 2c630531b17..9cead57c6a3 100644 --- a/lib/private/OCS/CoreCapabilities.php +++ b/lib/private/OCS/CoreCapabilities.php @@ -44,8 +44,6 @@ class CoreCapabilities implements ICapability { /** * Return this classes capabilities - * - * @return array */ public function getCapabilities() { return [ diff --git a/lib/public/Capabilities/ICapability.php b/lib/public/Capabilities/ICapability.php index fed1dba49d1..2d3f5215736 100644 --- a/lib/public/Capabilities/ICapability.php +++ b/lib/public/Capabilities/ICapability.php @@ -25,11 +25,8 @@ namespace OCP\Capabilities; * Minimal interface that has to be implemented for a class to be considered * a capability. * - * In an application use: - * $this->getContainer()->registerCapability('OCA\MY_APP\Capabilities'); - * To register capabilities. - * - * The class 'OCA\MY_APP\Capabilities' must then implement ICapability + * In an application use \OCP\AppFramework\Bootstrap\IRegistrationContext::registerCapability + * to register capabilities. * * @since 8.2.0 */ @@ -37,7 +34,19 @@ interface ICapability { /** * Function an app uses to return the capabilities * - * @return array Array containing the apps capabilities + * ```php + * return [ + * 'myapp' => [ + * 'awesomefeature' => true, + * 'featureversion' => 3, + * ], + * 'morecomplex' => [ + * 'a' => [1, 2], + * ], + * ]; + * ``` + * + * @return array<string, array<string, mixed>> Indexed array containing the app's capabilities * @since 8.2.0 */ public function getCapabilities(); |