diff --git a/src/Cluster/ClusterStrategy.php b/src/Cluster/ClusterStrategy.php index 16f30521..1891907f 100644 --- a/src/Cluster/ClusterStrategy.php +++ b/src/Cluster/ClusterStrategy.php @@ -288,7 +288,7 @@ abstract class ClusterStrategy implements StrategyInterface $keys = array($firstKey); - for ($i = 1; $i < $argc; $i++) { + for ($i = 1; $i < $argc; ++$i) { if (strtoupper($arguments[$i]) === 'STORE') { $keys[] = $arguments[++$i]; } @@ -347,7 +347,7 @@ abstract class ClusterStrategy implements StrategyInterface if ($argc > $startIndex) { $keys = array($arguments[0]); - for ($i = $startIndex; $i < $argc; $i++) { + for ($i = $startIndex; $i < $argc; ++$i) { $argument = strtoupper($arguments[$i]); if ($argument === 'STORE' || $argument === 'STOREDIST') { $keys[] = $arguments[++$i]; @@ -357,7 +357,7 @@ abstract class ClusterStrategy implements StrategyInterface if ($this->checkSameSlotForKeys($keys)) { return $arguments[0]; } else { - return null; + return; } } diff --git a/src/PubSub/AbstractConsumer.php b/src/PubSub/AbstractConsumer.php index d7423f1e..8c6a71dd 100644 --- a/src/PubSub/AbstractConsumer.php +++ b/src/PubSub/AbstractConsumer.php @@ -18,17 +18,17 @@ namespace Predis\PubSub; */ abstract class AbstractConsumer implements \Iterator { - const SUBSCRIBE = 'subscribe'; - const UNSUBSCRIBE = 'unsubscribe'; - const PSUBSCRIBE = 'psubscribe'; + const SUBSCRIBE = 'subscribe'; + const UNSUBSCRIBE = 'unsubscribe'; + const PSUBSCRIBE = 'psubscribe'; const PUNSUBSCRIBE = 'punsubscribe'; - const MESSAGE = 'message'; - const PMESSAGE = 'pmessage'; - const PONG = 'pong'; + const MESSAGE = 'message'; + const PMESSAGE = 'pmessage'; + const PONG = 'pong'; - const STATUS_VALID = 1; // 0b0001 - const STATUS_SUBSCRIBED = 2; // 0b0010 - const STATUS_PSUBSCRIBED = 4; // 0b0100 + const STATUS_VALID = 1; // 0b0001 + const STATUS_SUBSCRIBED = 2; // 0b0010 + const STATUS_PSUBSCRIBED = 4; // 0b0100 private $position = null; private $statusFlags = self::STATUS_VALID; diff --git a/src/Replication/ReplicationStrategy.php b/src/Replication/ReplicationStrategy.php index 72be1564..cd2d0ed5 100644 --- a/src/Replication/ReplicationStrategy.php +++ b/src/Replication/ReplicationStrategy.php @@ -103,7 +103,7 @@ class ReplicationStrategy $argc = count($arguments); if ($argc > 1) { - for ($i = 1; $i < $argc; $i++) { + for ($i = 1; $i < $argc; ++$i) { $argument = strtoupper($arguments[$i]); if ($argument === 'STORE') { return false; @@ -128,7 +128,7 @@ class ReplicationStrategy $argc = count($arguments); if ($argc >= 2) { - for ($i = 1; $i < $argc; $i++) { + for ($i = 1; $i < $argc; ++$i) { $argument = strtoupper($arguments[$i]); if ($argument === 'SET' || $argument === 'INCRBY') { return false; @@ -154,7 +154,7 @@ class ReplicationStrategy $startIndex = $command->getId() === 'GEORADIUS' ? 5 : 4; if ($argc > $startIndex) { - for ($i = $startIndex; $i < $argc; $i++) { + for ($i = $startIndex; $i < $argc; ++$i) { $argument = strtoupper($arguments[$i]); if ($argument === 'STORE' || $argument === 'STOREDIST') { return false; diff --git a/src/Transaction/MultiExecState.php b/src/Transaction/MultiExecState.php index a0a82852..4bed42af 100644 --- a/src/Transaction/MultiExecState.php +++ b/src/Transaction/MultiExecState.php @@ -20,9 +20,9 @@ class MultiExecState { const INITIALIZED = 1; // 0b00001 const INSIDEBLOCK = 2; // 0b00010 - const DISCARDED = 4; // 0b00100 - const CAS = 8; // 0b01000 - const WATCH = 16; // 0b10000 + const DISCARDED = 4; // 0b00100 + const CAS = 8; // 0b01000 + const WATCH = 16; // 0b10000 private $flags; diff --git a/tests/Predis/Command/GeospatialGeoPosTest.php b/tests/Predis/Command/GeospatialGeoPosTest.php index 18c87638..34e39f77 100644 --- a/tests/Predis/Command/GeospatialGeoPosTest.php +++ b/tests/Predis/Command/GeospatialGeoPosTest.php @@ -67,13 +67,13 @@ class GeospatialGeoPosTest extends PredisCommandTestCase public function testParseResponse() { $raw = array( - array("13.361389338970184", "38.115556395496299"), - array("15.087267458438873", "37.50266842333162"), + array('13.361389338970184', '38.115556395496299'), + array('15.087267458438873', '37.50266842333162'), ); $expected = array( - array("13.361389338970184", "38.115556395496299"), - array("15.087267458438873", "37.50266842333162"), + array('13.361389338970184', '38.115556395496299'), + array('15.087267458438873', '37.50266842333162'), ); $command = $this->getCommand(); @@ -91,8 +91,8 @@ class GeospatialGeoPosTest extends PredisCommandTestCase $redis->geoadd('Sicily', '13.361389', '38.115556', 'Palermo', '15.087269', '37.502669', 'Catania'); $this->assertEquals(array( - array("13.361389338970184", "38.115556395496299"), - array("15.087267458438873", "37.50266842333162"), + array('13.361389338970184', '38.115556395496299'), + array('15.087267458438873', '37.50266842333162'), ), $redis->geopos('Sicily', 'Palermo', 'Catania')); } diff --git a/tests/Predis/Command/GeospatialGeoRadiusByMemberTest.php b/tests/Predis/Command/GeospatialGeoRadiusByMemberTest.php index b5523495..f6c01d53 100644 --- a/tests/Predis/Command/GeospatialGeoRadiusByMemberTest.php +++ b/tests/Predis/Command/GeospatialGeoRadiusByMemberTest.php @@ -40,12 +40,12 @@ class GeospatialGeoRadiusByMemberTest extends PredisCommandTestCase { $arguments = array( 'Sicily', 'Agrigento', 100, 'km', - 'WITHCOORD', 'WITHDIST', 'WITHHASH', 'COUNT', 1, 'ASC', 'STORE', 'key:store', 'STOREDIST', 'key:storedist' + 'WITHCOORD', 'WITHDIST', 'WITHHASH', 'COUNT', 1, 'ASC', 'STORE', 'key:store', 'STOREDIST', 'key:storedist', ); $expected = array( 'Sicily', 'Agrigento', 100, 'km', - 'WITHCOORD', 'WITHDIST', 'WITHHASH', 'COUNT', 1, 'ASC', 'STORE', 'key:store', 'STOREDIST', 'key:storedist' + 'WITHCOORD', 'WITHDIST', 'WITHHASH', 'COUNT', 1, 'ASC', 'STORE', 'key:store', 'STOREDIST', 'key:storedist', ); $command = $this->getCommand(); @@ -73,7 +73,7 @@ class GeospatialGeoRadiusByMemberTest extends PredisCommandTestCase $expected = array( 'Sicily', 'Agrigento', 100, 'km', - 'WITHCOORD', 'WITHDIST', 'WITHHASH', 'COUNT', 1, 'ASC', 'STORE', 'key:store', 'STOREDIST', 'key:storedist' + 'WITHCOORD', 'WITHDIST', 'WITHHASH', 'COUNT', 1, 'ASC', 'STORE', 'key:store', 'STOREDIST', 'key:storedist', ); $command = $this->getCommand(); diff --git a/tests/Predis/Command/GeospatialGeoRadiusTest.php b/tests/Predis/Command/GeospatialGeoRadiusTest.php index 83d74bed..77bede63 100644 --- a/tests/Predis/Command/GeospatialGeoRadiusTest.php +++ b/tests/Predis/Command/GeospatialGeoRadiusTest.php @@ -40,12 +40,12 @@ class GeospatialGeoRadiusTest extends PredisCommandTestCase { $arguments = array( 'Sicily', 15, 37, 200, 'km', - 'WITHCOORD', 'WITHDIST', 'WITHHASH', 'COUNT', 1, 'ASC', 'STORE', 'key:store', 'STOREDIST', 'key:storedist' + 'WITHCOORD', 'WITHDIST', 'WITHHASH', 'COUNT', 1, 'ASC', 'STORE', 'key:store', 'STOREDIST', 'key:storedist', ); $expected = array( 'Sicily', 15, 37, 200, 'km', - 'WITHCOORD', 'WITHDIST', 'WITHHASH', 'COUNT', 1, 'ASC', 'STORE', 'key:store', 'STOREDIST', 'key:storedist' + 'WITHCOORD', 'WITHDIST', 'WITHHASH', 'COUNT', 1, 'ASC', 'STORE', 'key:store', 'STOREDIST', 'key:storedist', ); $command = $this->getCommand(); @@ -73,7 +73,7 @@ class GeospatialGeoRadiusTest extends PredisCommandTestCase $expected = array( 'Sicily', 15, 37, 200, 'km', - 'WITHCOORD', 'WITHDIST', 'WITHHASH', 'COUNT', 1, 'ASC', 'STORE', 'key:store', 'STOREDIST', 'key:storedist' + 'WITHCOORD', 'WITHDIST', 'WITHHASH', 'COUNT', 1, 'ASC', 'STORE', 'key:store', 'STOREDIST', 'key:storedist', ); $command = $this->getCommand();