Skip to content

Commit

Permalink
Merge pull request #165 from zamu87/master
Browse files Browse the repository at this point in the history
Fix PHP 8.1 warning with sentinel
  • Loading branch information
colinmollenhour authored Jun 20, 2022
2 parents 068a4e1 + e75ea1e commit 30915e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cm/Cache/Backend/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function __construct($options = array())
$sentinelClientOptions = isset($options['sentinel']) && is_array($options['sentinel'])
? $this->getClientOptions($options['sentinel'] + $options)
: $this->_clientOptions;
$servers = preg_split('/\s*,\s*/', trim($options['server']), NULL, PREG_SPLIT_NO_EMPTY);
$servers = preg_split('/\s*,\s*/', trim($options['server']), -1, PREG_SPLIT_NO_EMPTY);
$sentinel = NULL;
$exception = NULL;
for ($i = 0; $i <= $sentinelClientOptions->connectRetries; $i++) // Try each sentinel in round-robin fashion
Expand Down Expand Up @@ -210,7 +210,7 @@ public function __construct($options = array())

$this->_redis = $redisMaster;
break 2;
} catch (Exception $e) {
} catch (\Exception $e) {
unset($sentinelClient);
$exception = $e;
}
Expand Down

0 comments on commit 30915e6

Please sign in to comment.