Skip to content

Commit dbe13c3

Browse files
committed
Fixes
1 parent 4f065e8 commit dbe13c3

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

src/Dashboards/APCu/APCuTrait.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ private function keysTreeView(array $keys): array {
282282
'expanded' => false,
283283
];
284284
}
285+
285286
$current = &$current[$part]['children'];
286287
}
287288
}

src/Dashboards/Memcached/MemcachedTrait.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ private function keysTreeView(array $keys): array {
295295
'expanded' => false,
296296
];
297297
}
298+
298299
$current = &$current[$part]['children'];
299300
}
300301
}

src/Dashboards/OPCache/OPCacheTrait.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,7 @@ private function getCachedScripts(): array {
148148
}
149149
}
150150

151-
$cached_scripts = Helpers::sortKeys($this->template, $cached_scripts);
152-
153-
return $cached_scripts;
151+
return Helpers::sortKeys($this->template, $cached_scripts);
154152
}
155153

156154
private function mainDashboard(): string {

src/Dashboards/Realpath/RealpathTrait.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ private function getAllKeys(): array {
6161
}
6262
}
6363

64-
$keys = Helpers::sortKeys($this->template, $keys);
65-
66-
return $keys;
64+
return Helpers::sortKeys($this->template, $keys);
6765
}
6866
}

src/Dashboards/Redis/RedisTrait.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ private function keysTreeView(array $keys): array {
427427
'expanded' => false,
428428
];
429429
}
430+
430431
$current = &$current[$part]['children'];
431432
}
432433
}

tests/TestCase.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static function keysProvider(): array {
5555
* @return array<int|string, mixed>
5656
*/
5757
public function sortKeys(array $keys): array {
58-
usort($keys, static fn ($a, $b) => strcmp($a['key'], $b['key']));
58+
usort($keys, static fn ($a, $b): int => strcmp((string) $a['key'], (string) $b['key']));
5959

6060
return $keys;
6161
}
@@ -68,8 +68,8 @@ public function sortKeys(array $keys): array {
6868
public function sortTreeKeys(array $tree): array {
6969
foreach ($tree as &$item) {
7070
if (isset($item['children'])) {
71-
usort($item['children'], static fn ($a, $b) => strcmp($a['key'], $b['key']));
72-
$item['children'] = self::sortTreeKeys($item['children']);
71+
usort($item['children'], static fn ($a, $b): int => strcmp((string) $a['key'], (string) $b['key']));
72+
$item['children'] = $this->sortTreeKeys($item['children']);
7373
}
7474
}
7575

@@ -91,7 +91,7 @@ public function normalizeInfoFields(array $data, array $fields): array {
9191
}
9292

9393
if (isset($item['children']) && is_array($item['children'])) {
94-
$item['children'] = array_map(static function (array $child) use ($fields) {
94+
$item['children'] = array_map(static function (array $child) use ($fields): array {
9595
foreach ($fields as $field) {
9696
if (isset($child['info'][$field])) {
9797
$child['info'][$field] = 0;

0 commit comments

Comments
 (0)