Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable29] fix(INavigationManager): Fix psalm alias not set in the right place #45645

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/ResponseDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@
*
* @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,
Expand Down
18 changes: 8 additions & 10 deletions core/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@
"type": "object",
"required": [
"id",
"order",
"href",
"icon",
"type",
Expand All @@ -232,15 +231,8 @@
"type": "string"
},
"order": {
"oneOf": [
{
"type": "integer",
"format": "int64"
},
{
"type": "string"
}
]
"type": "integer",
"format": "int64"
},
"href": {
"type": "string"
Expand All @@ -254,6 +246,12 @@
"name": {
"type": "string"
},
"app": {
"type": "string"
},
"default": {
"type": "boolean"
},
"active": {
"type": "boolean"
},
Expand Down
2 changes: 1 addition & 1 deletion lib/private/NavigationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function add($entry) {
// 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;
Expand Down
6 changes: 2 additions & 4 deletions lib/public/INavigationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@

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 {
/**
Expand Down
Loading