Skip to content

Commit 87383a1

Browse files
Remove is_array checks
Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>
1 parent 457659d commit 87383a1

2 files changed

Lines changed: 5 additions & 18 deletions

File tree

tests/ValkeyGlideClusterTest.php

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -424,20 +424,10 @@ protected function waitForSaveNotInProgress()
424424
{
425425
$this->waitFor(function () {
426426
$info = $this->valkey_glide->info('allPrimaries', 'persistence');
427-
if (!is_array($info)) {
428-
return true;
429-
}
430427
foreach ($info as $nodeInfo) {
431-
if (is_array($nodeInfo)) {
432-
if (($nodeInfo['rdb_bgsave_in_progress'] ?? '0') == '1'
433-
|| ($nodeInfo['aof_rewrite_in_progress'] ?? '0') == '1') {
434-
return false;
435-
}
436-
} elseif (is_string($nodeInfo)) {
437-
if (strpos($nodeInfo, 'rdb_bgsave_in_progress:1') !== false
438-
|| strpos($nodeInfo, 'aof_rewrite_in_progress:1') !== false) {
439-
return false;
440-
}
428+
if ($nodeInfo['rdb_bgsave_in_progress'] == '1'
429+
|| $nodeInfo['aof_rewrite_in_progress'] == '1') {
430+
return false;
441431
}
442432
}
443433
return true;

tests/ValkeyGlideTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2645,11 +2645,8 @@ protected function waitForSaveNotInProgress()
26452645
{
26462646
$this->waitFor(function () {
26472647
$info = $this->valkey_glide->info('persistence');
2648-
if (!is_array($info)) {
2649-
return true;
2650-
}
2651-
return ($info['rdb_bgsave_in_progress'] ?? '0') != '1'
2652-
&& ($info['aof_rewrite_in_progress'] ?? '0') != '1';
2648+
return $info['rdb_bgsave_in_progress'] != '1'
2649+
&& $info['aof_rewrite_in_progress'] != '1';
26532650
}, 10, 'Timed out waiting for background save to complete');
26542651
}
26552652

0 commit comments

Comments
 (0)