Skip to content

Commit 87d5dd0

Browse files
authored
Update SentinelReplication.php
1 parent c0d55b8 commit 87d5dd0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Connection/Replication/SentinelReplication.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,9 +513,11 @@ public function getSlaves()
513513
*/
514514
protected function pickSlave()
515515
{
516-
if ($slaves = $this->getSlaves()) {
517-
return $slaves[rand(1, count($slaves)) - 1];
518-
}
516+
$slaves = $this->getSlaves();
517+
518+
return $slaves
519+
? $slaves[rand(1, count($slaves)) - 1]
520+
: null;
519521
}
520522

521523
/**

0 commit comments

Comments
 (0)