mirror of
https://github.com/predis/predis.git
synced 2026-09-18 14:28:54 +00:00
Fix the bitmask used to check the state of subscriptions in a PubSub context.
The old code was not really broken, but this one is more appropriate.
This commit is contained in:
@@ -112,7 +112,7 @@ class PubSubContext implements \Iterator {
|
||||
|
||||
public function valid() {
|
||||
$isValid = $this->isFlagSet(self::STATUS_VALID);
|
||||
$subscriptionFlags = self::STATUS_SUBSCRIBED + self::STATUS_PSUBSCRIBED;
|
||||
$subscriptionFlags = self::STATUS_SUBSCRIBED | self::STATUS_PSUBSCRIBED;
|
||||
$hasSubscriptions = ($this->_statusFlags & $subscriptionFlags) > 0;
|
||||
return $isValid && $hasSubscriptions;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user