Parcourir la source

Run php-cs-fixer.

Daniele Alessandri il y a 8 ans
Parent
commit
ad7b8b08cb

+ 3 - 3
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;
             }
         }
 

+ 9 - 9
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;

+ 3 - 3
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;

+ 3 - 3
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;
 

+ 6 - 6
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'));
     }
 

+ 3 - 3
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();

+ 3 - 3
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();