Skip to content

Commit 006cb26

Browse files
committed
Fixes
1 parent 84367ff commit 006cb26

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

src/Dashboards/Redis/Compatibility/Cluster/PredisCluster.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private function combineValues(string $key, array $values, ?array $combine): mix
147147
return $unique[0];
148148
}
149149

150-
$numeric = array_filter($values, 'is_numeric');
150+
$numeric = array_filter($values, is_numeric(...));
151151

152152
if ($combine && in_array($key, $combine, true) && count($numeric) === count($values)) {
153153
return array_sum($values);

src/Dashboards/Redis/Compatibility/Cluster/RedisCluster.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ private function combineValues(string $key, array $values, ?array $combine): mix
151151
return $unique[0];
152152
}
153153

154-
$numeric = array_filter($values, 'is_numeric');
154+
$numeric = array_filter($values, is_numeric(...));
155155

156156
if ($combine && in_array($key, $combine, true) && count($numeric) === count($values)) {
157157
return array_sum($values);

src/Dashboards/Redis/RedisTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ private function memoryPanel(array $info): ?array {
151151
'Free' => $max_memory > 0 ? Format::bytes($max_memory - $used_memory) : '',
152152
'Peak memory usage' => Format::bytes((int) ($memory_info['used_memory_peak'] ?? 0)),
153153
'Fragmentation ratio' => $memory_info['mem_fragmentation_ratio'] ?? 'N/A',
154-
'Lua memory usage' => Format::bytes((int) ($memory_info['used_memory_lua'] ?? 0)),
154+
'Lua memory usage' => Format::bytes((int) ($memory_info['used_memory_lua'] ?? 0)),
155155
],
156156
];
157157
}

src/Helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public static function serverSelector(Template $template, array $servers, int $s
187187
return '';
188188
}
189189

190-
$options = array_map(static fn (array $server): string => self::getServerTitle($server), $servers);
190+
$options = array_map(self::getServerTitle(...), $servers);
191191

192192
return $template->render('components/select', [
193193
'id' => 'server_select',

src/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function autoload(string $path): void {
5454
});
5555
}
5656

57-
if (!extension_loaded('xdebug') && php_sapi_name() !== 'cli') {
57+
if (!extension_loaded('xdebug') && PHP_SAPI !== 'cli') {
5858
set_error_handler(static function (int $errno, string $errstr, string $errfile, int $errline): bool {
5959
if ((error_reporting() & $errno) === 0) {
6060
return false;

tests/Dashboards/Redis/PredisTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use Predis\Client;
1212

13-
class PredisTest extends RedisTestCase {
13+
final class PredisTest extends RedisTestCase {
1414
public static function setUpBeforeClass(): void {
1515
parent::setUpBeforeClass();
1616

tests/Dashboards/Redis/RedisTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
namespace Tests\Dashboards\Redis;
1010

11-
class RedisTest extends RedisTestCase {
11+
final class RedisTest extends RedisTestCase {
1212
protected string $client = 'redis';
1313
}

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
1818
*/
1919
public function deleteKeysHelper(Template $template, array|string $keys, callable $delete_key, bool $base64 = false): void {
2020
if ($base64) {
21-
$keys_b64 = is_array($keys) ? array_map(static fn (string $key): string => base64_encode($key), $keys) : base64_encode($keys);
21+
$keys_b64 = is_array($keys) ? array_map(base64_encode(...), $keys) : base64_encode($keys);
2222
}
2323

2424
try {

0 commit comments

Comments
 (0)