summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2023-10-05 16:32:57 +0200
committerGitHub <noreply@github.com>2023-10-05 16:32:57 +0200
commit75956192fede20d9fa6aed7bc93f1f386dedfbe5 (patch)
treeedbb81e00c371155453c7770813f1866ca3df196
parentbdb9c06111388f63a5d348286da7f06e5440f740 (diff)
parentf632c630d2162e887b788446059490d732db9f22 (diff)
Merge pull request #10639 from nextcloud/techdebt/noid/add-typing-to-capabilities
fix(docs): Add typing to capabilities
-rw-r--r--composer.json1
-rw-r--r--lib/Capabilities.php39
2 files changed, 40 insertions, 0 deletions
diff --git a/composer.json b/composer.json
index 26592bb74..775a43267 100644
--- a/composer.json
+++ b/composer.json
@@ -20,6 +20,7 @@
"cs:fix": "php-cs-fixer fix",
"lint": "find . -name \\*.php -not -path './vendor/*' -not -path './vendor-bin/*' -not -path './lib/Vendor/*' -not -path './build/*' -not -path './tests/integration/vendor/*' -print0 | xargs -0 -n1 php -l",
"psalm": "psalm --threads=1",
+ "psalm:dev": "psalm --no-cache --threads=$(nproc)",
"psalm:update-baseline": "psalm --threads=1 --update-baseline --set-baseline=tests/psalm-baseline.xml",
"psalm:clear": "psalm --clear-cache && psalm --clear-global-cache",
"psalm:fix": "psalm --alter --issues=InvalidReturnType,InvalidNullableReturnType,MissingParamType,InvalidFalsableReturnType",
diff --git a/lib/Capabilities.php b/lib/Capabilities.php
index 21b023618..774cd89bf 100644
--- a/lib/Capabilities.php
+++ b/lib/Capabilities.php
@@ -5,6 +5,7 @@ declare(strict_types=1);
* @copyright Copyright (c) 2018, Joas Schilling <coding@schilljs.com>
*
* @author Joas Schilling <coding@schilljs.com>
+ * @author Kate Döen <kate.doeen@nextcloud.com>
*
* @license GNU AGPL version 3 or any later version
*
@@ -52,6 +53,44 @@ class Capabilities implements IPublicCapability {
$this->talkCache = $cacheFactory->createLocal('talk::');
}
+ /**
+ * @return array{
+ * spreed: array{
+ * features: string[],
+ * config: array{
+ * attachments: array{
+ * allowed: bool,
+ * folder?: string,
+ * },
+ * call: array{
+ * enabled: bool,
+ * breakout-rooms: bool,
+ * recording: bool,
+ * supported-reactions: string[],
+ * predefined-backgrounds: string[],
+ * can-upload-background: bool,
+ * },
+ * chat: array{
+ * max-length: int,
+ * read-privacy: int,
+ * has-translation-providers: bool,
+ * typing-privacy: int,
+ * },
+ * conversations: array{
+ * can-create: bool,
+ * },
+ * previews: array{
+ * max-gif-size: int,
+ * },
+ * signaling: array{
+ * session-ping-limit: int,
+ * hello-v2-token-key?: string,
+ * },
+ * },
+ * version: string,
+ * },
+ * }|array<empty>
+ */
public function getCapabilities(): array {
$user = $this->userSession->getUser();
if ($user instanceof IUser && $this->talkConfig->isDisabledForUser($user)) {