aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKate <26026535+provokateurin@users.noreply.github.com>2024-06-03 17:11:20 +0200
committerGitHub <noreply@github.com>2024-06-03 17:11:20 +0200
commit88fe7348ed11cf81ed17e33fba98671f790f7a32 (patch)
tree939efe1e8c30df56e5572f6bc42a1ce630486066
parent4f3456296ba7ba6c17089ae68fd97c116c12dca5 (diff)
parent0d202e201b3c63376cab7980ae476e25c1003c28 (diff)
downloadnextcloud-server-88fe7348ed11cf81ed17e33fba98671f790f7a32.tar.gz
nextcloud-server-88fe7348ed11cf81ed17e33fba98671f790f7a32.zip
Merge pull request #45455 from nextcloud/fix/psalm/navigation-entries
-rw-r--r--core/ResponseDefinitions.php4
-rw-r--r--core/openapi.json18
-rw-r--r--lib/private/NavigationManager.php2
-rw-r--r--lib/public/INavigationManager.php6
4 files changed, 14 insertions, 16 deletions
diff --git a/core/ResponseDefinitions.php b/core/ResponseDefinitions.php
index 7a1dad464dd..93662fbaac4 100644
--- a/core/ResponseDefinitions.php
+++ b/core/ResponseDefinitions.php
@@ -26,11 +26,13 @@ namespace OCA\Core;
*
* @psalm-type CoreNavigationEntry = array{
* id: string,
- * order: int|string,
+ * order?: int,
* href: string,
* icon: string,
* type: string,
* name: string,
+ * app?: string,
+ * default?: bool,
* active: bool,
* classes: string,
* unread: int,
diff --git a/core/openapi.json b/core/openapi.json
index 94b93253704..e47819c19be 100644
--- a/core/openapi.json
+++ b/core/openapi.json
@@ -218,7 +218,6 @@
"type": "object",
"required": [
"id",
- "order",
"href",
"icon",
"type",
@@ -232,15 +231,8 @@
"type": "string"
},
"order": {
- "oneOf": [
- {
- "type": "integer",
- "format": "int64"
- },
- {
- "type": "string"
- }
- ]
+ "type": "integer",
+ "format": "int64"
},
"href": {
"type": "string"
@@ -254,6 +246,12 @@
"name": {
"type": "string"
},
+ "app": {
+ "type": "string"
+ },
+ "default": {
+ "type": "boolean"
+ },
"active": {
"type": "boolean"
},
diff --git a/lib/private/NavigationManager.php b/lib/private/NavigationManager.php
index 05a3a9c85fe..5d71c83e77a 100644
--- a/lib/private/NavigationManager.php
+++ b/lib/private/NavigationManager.php
@@ -95,7 +95,7 @@ class NavigationManager implements INavigationManager {
// This is the default app that will always be shown first
$entry['default'] = ($entry['app'] ?? false) === $this->defaultApp;
// Set order from user defined app order
- $entry['order'] = $this->customAppOrder[$id]['order'] ?? $entry['order'] ?? 100;
+ $entry['order'] = (int)($this->customAppOrder[$id]['order'] ?? $entry['order'] ?? 100);
}
$this->entries[$id] = $entry;
diff --git a/lib/public/INavigationManager.php b/lib/public/INavigationManager.php
index 5440230e44c..eaef1cb35ec 100644
--- a/lib/public/INavigationManager.php
+++ b/lib/public/INavigationManager.php
@@ -11,12 +11,10 @@
namespace OCP;
/**
- * @psalm-type NavigationEntry = array{id: string, order: int, href: string, name: string, app?: string, icon?: string, classes?: string, type?: string}
- */
-
-/**
* Manages the ownCloud navigation
* @since 6.0.0
+ *
+ * @psalm-type NavigationEntry = array{id: string, order: int, href: string, name: string, app?: string, icon?: string, classes?: string, type?: string}
*/
interface INavigationManager {
/**