From 1be836273ddba6e0ddb3509a1d898535df9fd169 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Wed, 15 Mar 2023 17:29:32 +0100 Subject: core: Add OpenAPI spec Signed-off-by: jld3103 --- lib/private/CapabilitiesManager.php | 2 +- lib/private/Contacts/ContactsMenu/Actions/LinkAction.php | 3 +++ lib/private/Contacts/ContactsMenu/Entry.php | 3 +++ lib/private/Updater/ChangesCheck.php | 1 + lib/public/Collaboration/Reference/Reference.php | 4 ++++ lib/public/Translation/LanguageTuple.php | 1 + 6 files changed, 13 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/private/CapabilitiesManager.php b/lib/private/CapabilitiesManager.php index 9e63798475b..7885a98869d 100644 --- a/lib/private/CapabilitiesManager.php +++ b/lib/private/CapabilitiesManager.php @@ -50,7 +50,7 @@ class CapabilitiesManager { * * @param bool $public get public capabilities only * @throws \InvalidArgumentException - * @return array + * @return array */ public function getCapabilities(bool $public = false, bool $initialState = false) : array { $capabilities = []; diff --git a/lib/private/Contacts/ContactsMenu/Actions/LinkAction.php b/lib/private/Contacts/ContactsMenu/Actions/LinkAction.php index 9fc021435a4..e0d3515f421 100644 --- a/lib/private/Contacts/ContactsMenu/Actions/LinkAction.php +++ b/lib/private/Contacts/ContactsMenu/Actions/LinkAction.php @@ -76,6 +76,9 @@ class LinkAction implements ILinkAction { return $this->appId; } + /** + * @return array{title: string, icon: string, hyperlink: string, appId: string} + */ public function jsonSerialize(): array { return [ 'title' => $this->name, diff --git a/lib/private/Contacts/ContactsMenu/Entry.php b/lib/private/Contacts/ContactsMenu/Entry.php index 649c83ae7d8..f1cb4f9c52f 100644 --- a/lib/private/Contacts/ContactsMenu/Entry.php +++ b/lib/private/Contacts/ContactsMenu/Entry.php @@ -141,6 +141,9 @@ class Entry implements IEntry { return $this->properties[$key]; } + /** + * @return array{id: int|string|null, fullName: string, avatar: string|null, topAction: mixed, actions: array, lastMessage: '', emailAddresses: string[], profileTitle: string|null, profileUrl: string|null} + */ public function jsonSerialize(): array { $topAction = !empty($this->actions) ? $this->actions[0]->jsonSerialize() : null; $otherActions = array_map(function (IAction $action) { diff --git a/lib/private/Updater/ChangesCheck.php b/lib/private/Updater/ChangesCheck.php index 2c1eb321ee0..ee4d1f1fcee 100644 --- a/lib/private/Updater/ChangesCheck.php +++ b/lib/private/Updater/ChangesCheck.php @@ -51,6 +51,7 @@ class ChangesCheck { /** * @throws DoesNotExistException + * @return array{changelogURL: string, whatsNew: array} */ public function getChangesForVersion(string $version): array { $version = $this->normalizeVersion($version); diff --git a/lib/public/Collaboration/Reference/Reference.php b/lib/public/Collaboration/Reference/Reference.php index 6b92a0fae52..0dcb665713c 100644 --- a/lib/public/Collaboration/Reference/Reference.php +++ b/lib/public/Collaboration/Reference/Reference.php @@ -27,6 +27,7 @@ namespace OCP\Collaboration\Reference; /** * @since 25.0.0 + * @psalm-type OpenGraphObject = array{id: string, name: string, description: ?string, thumb: ?string, link: string} */ class Reference implements IReference { protected string $reference; @@ -176,6 +177,7 @@ class Reference implements IReference { /** * @inheritdoc * @since 25.0.0 + * @return array */ public function getRichObject(): array { if ($this->richObject === null) { @@ -187,6 +189,7 @@ class Reference implements IReference { /** * @inheritdoc * @since 25.0.0 + * @return OpenGraphObject */ public function getOpenGraphObject(): array { return [ @@ -237,6 +240,7 @@ class Reference implements IReference { /** * @inheritdoc * @since 25.0.0 + * @return array{richObjectType: string, richObject: array, openGraphObject: OpenGraphObject, accessible: bool} */ public function jsonSerialize() { return [ diff --git a/lib/public/Translation/LanguageTuple.php b/lib/public/Translation/LanguageTuple.php index 9defb17e4b6..27f932f0a64 100644 --- a/lib/public/Translation/LanguageTuple.php +++ b/lib/public/Translation/LanguageTuple.php @@ -45,6 +45,7 @@ class LanguageTuple implements JsonSerializable { /** * @since 26.0.0 + * @return array{from: string, fromLabel: string, to: string, toLabel: string} */ public function jsonSerialize(): array { return [ -- cgit v1.2.3