From 8dd9893a2fb3a3b124e2ab78eb675acece39e671 Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Fri, 24 Jul 2015 23:05:30 +0200 Subject: [PATCH] Run php-cs-fixer with new configuration. --- examples/custom_cluster_distributor.php | 6 ++--- examples/executing_redis_commands.php | 4 ++-- examples/lua_scripting_abstraction.php | 2 +- examples/monitor_consumer.php | 2 +- examples/pubsub_consumer.php | 2 +- examples/redis_collections_iterators.php | 2 +- examples/replication_complex.php | 2 +- examples/session_handler.php | 2 +- examples/shared.php | 2 +- examples/transaction_using_cas.php | 2 +- src/Client.php | 12 +++++----- src/Cluster/RedisStrategy.php | 4 ++-- src/Command/ZSetReverseRangeByLex.php | 2 ++ src/Connection/AbstractConnection.php | 4 ++-- src/Connection/Aggregate/PredisCluster.php | 2 +- src/Connection/Aggregate/RedisCluster.php | 8 +++---- src/Connection/Factory.php | 2 +- src/Connection/Parameters.php | 4 ++-- src/Connection/PhpiredisSocketConnection.php | 2 +- src/Connection/PhpiredisStreamConnection.php | 2 +- src/Connection/WebdisConnection.php | 4 ++-- src/Monitor/Consumer.php | 2 +- src/Pipeline/ConnectionErrorProof.php | 4 ++-- src/Pipeline/Pipeline.php | 6 ++--- src/Profile/Factory.php | 4 ++-- .../Handler/StreamableMultiBulkResponse.php | 2 +- src/Protocol/Text/ProtocolProcessor.php | 4 ++-- src/PubSub/Consumer.php | 2 +- src/Replication/ReplicationStrategy.php | 4 ++-- src/Transaction/MultiExec.php | 22 +++++++++---------- tests/PHPUnit/PredisCommandTestCase.php | 2 +- tests/PHPUnit/PredisConnectionTestCase.php | 2 +- tests/PHPUnit/PredisProfileTestCase.php | 2 +- tests/PHPUnit/PredisTestCase.php | 2 +- tests/Predis/Cluster/PredisStrategyTest.php | 2 +- tests/Predis/Cluster/RedisStrategyTest.php | 2 +- .../Collection/Iterator/HashKeyTest.php | 2 +- .../Collection/Iterator/KeyspaceTest.php | 2 +- .../Collection/Iterator/ListKeyTest.php | 2 +- .../Predis/Collection/Iterator/SetKeyTest.php | 2 +- .../Collection/Iterator/SortedSetKeyTest.php | 2 +- .../Processor/KeyPrefixProcessorTest.php | 2 +- .../Command/ZSetReverseRangeByLexTest.php | 2 ++ .../Configuration/ProfileOptionTest.php | 2 +- .../Aggregate/MasterSlaveReplicationTest.php | 2 +- .../Aggregate/PredisClusterTest.php | 2 +- .../Connection/Aggregate/RedisClusterTest.php | 2 +- .../Connection/WebdisConnectionTest.php | 2 +- tests/Predis/Monitor/ConsumerTest.php | 4 ++-- tests/Predis/Pipeline/AtomicTest.php | 2 +- tests/Predis/Pipeline/FireAndForgetTest.php | 2 +- tests/Predis/Pipeline/PipelineTest.php | 2 +- tests/Predis/PubSub/ConsumerTest.php | 2 +- tests/Predis/PubSub/DispatcherLoopTest.php | 2 +- .../Replication/ReplicationStrategyTest.php | 2 +- .../Response/Iterator/MultiBulkTest.php | 2 +- .../Response/Iterator/MultiBulkTupleTest.php | 2 +- .../AbortedMultiExecExceptionTest.php | 2 +- tests/Predis/Transaction/MultiExecTest.php | 2 +- 59 files changed, 93 insertions(+), 89 deletions(-) diff --git a/examples/custom_cluster_distributor.php b/examples/custom_cluster_distributor.php index 6ec35b20..0a3a421e 100644 --- a/examples/custom_cluster_distributor.php +++ b/examples/custom_cluster_distributor.php @@ -15,9 +15,9 @@ require __DIR__.'/shared.php'; // their own distributors used by the client to distribute keys among a cluster // of servers. -use Predis\Cluster\PredisStrategy; use Predis\Cluster\Distributor\DistributorInterface; use Predis\Cluster\Hash\HashGeneratorInterface; +use Predis\Cluster\PredisStrategy; use Predis\Connection\Aggregate\PredisCluster; class NaiveDistributor implements DistributorInterface, HashGeneratorInterface @@ -34,7 +34,7 @@ class NaiveDistributor implements DistributorInterface, HashGeneratorInterface public function add($node, $weight = null) { $this->nodes[] = $node; - $this->nodesCount++; + ++$this->nodesCount; } public function remove($node) @@ -99,7 +99,7 @@ $options = array( $client = new Predis\Client($multiple_servers, $options); -for ($i = 0; $i < 100; $i++) { +for ($i = 0; $i < 100; ++$i) { $client->set("key:$i", str_pad($i, 4, '0', 0)); $client->get("key:$i"); } diff --git a/examples/executing_redis_commands.php b/examples/executing_redis_commands.php index 475a6051..6e567536 100644 --- a/examples/executing_redis_commands.php +++ b/examples/executing_redis_commands.php @@ -26,7 +26,7 @@ var_export($response); echo PHP_EOL; $mkv = array( 'uid:0001' => '1st user', 'uid:0002' => '2nd user', - 'uid:0003' => '3rd user' + 'uid:0003' => '3rd user', ); $client->mset($mkv); @@ -45,7 +45,7 @@ array ( // their arguments are not filtered nor responses coming from Redis are parsed. $response = $client->executeRaw(array( - 'MGET', 'uid:0001', 'uid:0002', 'uid:0003' + 'MGET', 'uid:0001', 'uid:0002', 'uid:0003', )); var_export($response); echo PHP_EOL; diff --git a/examples/lua_scripting_abstraction.php b/examples/lua_scripting_abstraction.php index b02300c1..50c07bf4 100644 --- a/examples/lua_scripting_abstraction.php +++ b/examples/lua_scripting_abstraction.php @@ -55,7 +55,7 @@ $client = new Predis\Client($single_server, array( $profile->defineCommand('increxby', 'IncrementExistingKeysBy'); return $profile; - } + }, )); $client->mset('foo', 10, 'foobar', 100); diff --git a/examples/monitor_consumer.php b/examples/monitor_consumer.php index c72cc29f..d472049b 100644 --- a/examples/monitor_consumer.php +++ b/examples/monitor_consumer.php @@ -28,7 +28,7 @@ foreach (($monitor = $client->monitor()) as $event) { // If we notice a ECHO command with the message QUIT_MONITOR, we stop the // monitor consumer and then break the loop. if ($event->command === 'ECHO' && $event->arguments === '"QUIT_MONITOR"') { - echo "Exiting the monitor loop...", PHP_EOL; + echo 'Exiting the monitor loop...', PHP_EOL; $monitor->stop(); break; } diff --git a/examples/pubsub_consumer.php b/examples/pubsub_consumer.php index c8db4585..24c485cc 100644 --- a/examples/pubsub_consumer.php +++ b/examples/pubsub_consumer.php @@ -36,7 +36,7 @@ foreach ($pubsub as $message) { case 'message': if ($message->channel == 'control_channel') { if ($message->payload == 'quit_loop') { - echo "Aborting pubsub loop...", PHP_EOL; + echo 'Aborting pubsub loop...', PHP_EOL; $pubsub->unsubscribe(); } else { echo "Received an unrecognized command: {$message->payload}.", PHP_EOL; diff --git a/examples/redis_collections_iterators.php b/examples/redis_collections_iterators.php index 7c52f325..62755c9f 100644 --- a/examples/redis_collections_iterators.php +++ b/examples/redis_collections_iterators.php @@ -34,7 +34,7 @@ $client = new Predis\Client($single_server, array('profile' => '2.8')); // Prepare some keys for our example $client->del('predis:set', 'predis:zset', 'predis:hash'); -for ($i = 0; $i < 5; $i++) { +for ($i = 0; $i < 5; ++$i) { $client->sadd('predis:set', "member:$i"); $client->zadd('predis:zset', -$i, "member:$i"); $client->hset('predis:hash', "field:$i", "value:$i"); diff --git a/examples/replication_complex.php b/examples/replication_complex.php index c13d95fa..71193d23 100644 --- a/examples/replication_complex.php +++ b/examples/replication_complex.php @@ -81,5 +81,5 @@ $hashes = $client->hmgetall('metavars', 'servers'); $replication = $client->getConnection(); $stillOnSlave = $replication->getCurrent() === $replication->getConnectionById('slave'); -echo "Is still on slave? ", $stillOnSlave ? 'YES!' : 'NO!', PHP_EOL; +echo 'Is still on slave? ', $stillOnSlave ? 'YES!' : 'NO!', PHP_EOL; var_export($hashes); diff --git a/examples/session_handler.php b/examples/session_handler.php index cf8f04ae..4868a4df 100644 --- a/examples/session_handler.php +++ b/examples/session_handler.php @@ -25,7 +25,7 @@ require __DIR__.'/shared.php'; // if (!interface_exists('SessionHandlerInterface')) { - die("ATTENTION: the session handler implemented by Predis requires PHP >= 5.4.0 ". + die('ATTENTION: the session handler implemented by Predis requires PHP >= 5.4.0 '. "or a polyfill for SessionHandlerInterface provided by an external package.\n"); } diff --git a/examples/shared.php b/examples/shared.php index 73d534f2..00e3faf9 100644 --- a/examples/shared.php +++ b/examples/shared.php @@ -25,7 +25,7 @@ function redis_version($info) $single_server = array( 'host' => '127.0.0.1', 'port' => 6379, - 'database' => 15 + 'database' => 15, ); $multiple_servers = array( diff --git a/examples/transaction_using_cas.php b/examples/transaction_using_cas.php index b79c1a76..68bc4676 100644 --- a/examples/transaction_using_cas.php +++ b/examples/transaction_using_cas.php @@ -49,4 +49,4 @@ function zpop($client, $key) $client = new Predis\Client($single_server); $zpopped = zpop($client, 'zset'); -echo isset($zpopped) ? "ZPOPed $zpopped" : "Nothing to ZPOP!", PHP_EOL; +echo isset($zpopped) ? "ZPOPed $zpopped" : 'Nothing to ZPOP!', PHP_EOL; diff --git a/src/Client.php b/src/Client.php index 9c902dcf..2c64b23b 100644 --- a/src/Client.php +++ b/src/Client.php @@ -16,8 +16,8 @@ use Predis\Command\RawCommand; use Predis\Command\ScriptCommand; use Predis\Configuration\Options; use Predis\Configuration\OptionsInterface; -use Predis\Connection\ConnectionInterface; use Predis\Connection\AggregateConnectionInterface; +use Predis\Connection\ConnectionInterface; use Predis\Connection\ParametersInterface; use Predis\Monitor\Consumer as MonitorConsumer; use Predis\Pipeline\Pipeline; @@ -64,9 +64,9 @@ class Client implements ClientInterface * * @param mixed $options Client options. * + * @throws \InvalidArgumentException * @return OptionsInterface * - * @throws \InvalidArgumentException */ protected function createOptions($options) { @@ -96,9 +96,9 @@ class Client implements ClientInterface * * @param mixed $parameters Connection parameters or connection instance. * + * @throws \InvalidArgumentException * @return ConnectionInterface * - * @throws \InvalidArgumentException */ protected function createConnection($parameters) { @@ -189,9 +189,9 @@ class Client implements ClientInterface * * @param string $connectionID Identifier of a connection. * + * @throws \InvalidArgumentException * @return Client * - * @throws \InvalidArgumentException */ public function getClientFor($connectionID) { @@ -253,9 +253,9 @@ class Client implements ClientInterface * * @param string $connectionID Index or alias of the single connection. * + * @throws NotSupportedException * @return Connection\NodeConnectionInterface * - * @throws NotSupportedException */ public function getConnectionById($connectionID) { @@ -342,9 +342,9 @@ class Client implements ClientInterface * @param CommandInterface $command Redis command that generated the error. * @param ErrorResponseInterface $response Instance of the error response. * + * @throws ServerException * @return mixed * - * @throws ServerException */ protected function onErrorResponse(CommandInterface $command, ErrorResponseInterface $response) { diff --git a/src/Cluster/RedisStrategy.php b/src/Cluster/RedisStrategy.php index f3968db7..df0bdb49 100644 --- a/src/Cluster/RedisStrategy.php +++ b/src/Cluster/RedisStrategy.php @@ -11,9 +11,9 @@ namespace Predis\Cluster; -use Predis\NotSupportedException; -use Predis\Cluster\Hash\HashGeneratorInterface; use Predis\Cluster\Hash\CRC16; +use Predis\Cluster\Hash\HashGeneratorInterface; +use Predis\NotSupportedException; /** * Default class used by Predis to calculate hashes out of keys of diff --git a/src/Command/ZSetReverseRangeByLex.php b/src/Command/ZSetReverseRangeByLex.php index b9eb2512..cdd8ba62 100644 --- a/src/Command/ZSetReverseRangeByLex.php +++ b/src/Command/ZSetReverseRangeByLex.php @@ -3,6 +3,8 @@ /* * This file is part of the Predis package. * + * (c) Daniele Alessandri + * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ diff --git a/src/Connection/AbstractConnection.php b/src/Connection/AbstractConnection.php index c6893e06..ad2220d5 100644 --- a/src/Connection/AbstractConnection.php +++ b/src/Connection/AbstractConnection.php @@ -11,8 +11,8 @@ namespace Predis\Connection; -use Predis\CommunicationException; use Predis\Command\CommandInterface; +use Predis\CommunicationException; use Predis\Protocol\ProtocolException; /** @@ -51,9 +51,9 @@ abstract class AbstractConnection implements NodeConnectionInterface * * @param ParametersInterface $parameters Initialization parameters for the connection. * + * @throws \InvalidArgumentException * @return ParametersInterface * - * @throws \InvalidArgumentException */ protected function assertParameters(ParametersInterface $parameters) { diff --git a/src/Connection/Aggregate/PredisCluster.php b/src/Connection/Aggregate/PredisCluster.php index 7fb92800..33f98bf2 100644 --- a/src/Connection/Aggregate/PredisCluster.php +++ b/src/Connection/Aggregate/PredisCluster.php @@ -11,11 +11,11 @@ namespace Predis\Connection\Aggregate; -use Predis\NotSupportedException; use Predis\Cluster\PredisStrategy; use Predis\Cluster\StrategyInterface; use Predis\Command\CommandInterface; use Predis\Connection\NodeConnectionInterface; +use Predis\NotSupportedException; /** * Abstraction for a cluster of aggregate connections to various Redis servers diff --git a/src/Connection/Aggregate/RedisCluster.php b/src/Connection/Aggregate/RedisCluster.php index 3ffe4535..65c69cfd 100644 --- a/src/Connection/Aggregate/RedisCluster.php +++ b/src/Connection/Aggregate/RedisCluster.php @@ -11,13 +11,13 @@ namespace Predis\Connection\Aggregate; -use Predis\NotSupportedException; -use Predis\Cluster\StrategyInterface; use Predis\Cluster\RedisStrategy as RedisClusterStrategy; +use Predis\Cluster\StrategyInterface; use Predis\Command\CommandInterface; use Predis\Command\RawCommand; -use Predis\Connection\NodeConnectionInterface; use Predis\Connection\FactoryInterface; +use Predis\Connection\NodeConnectionInterface; +use Predis\NotSupportedException; use Predis\Response\ErrorInterface as ErrorResponseInterface; /** @@ -313,9 +313,9 @@ class RedisCluster implements ClusterInterface, \IteratorAggregate, \Countable * * @param int $slot Slot index. * + * @throws \OutOfBoundsException * @return NodeConnectionInterface * - * @throws \OutOfBoundsException */ public function getConnectionBySlot($slot) { diff --git a/src/Connection/Factory.php b/src/Connection/Factory.php index b097d63e..e7a4e17f 100644 --- a/src/Connection/Factory.php +++ b/src/Connection/Factory.php @@ -34,9 +34,9 @@ class Factory implements FactoryInterface * * @param mixed $initializer FQN of a connection class or a callable for lazy initialization. * + * @throws \InvalidArgumentException * @return mixed * - * @throws \InvalidArgumentException */ protected function checkInitializer($initializer) { diff --git a/src/Connection/Parameters.php b/src/Connection/Parameters.php index 4bc59b57..13af0eb0 100644 --- a/src/Connection/Parameters.php +++ b/src/Connection/Parameters.php @@ -69,9 +69,9 @@ class Parameters implements ParametersInterface * * @param string $uri URI string. * + * @throws \InvalidArgumentException * @return array * - * @throws \InvalidArgumentException */ public static function parse($uri) { @@ -111,9 +111,9 @@ class Parameters implements ParametersInterface * * @param string $uri URI string. * + * @throws \InvalidArgumentException * @return array * - * @throws \InvalidArgumentException */ public static function parseIANA($uri) { diff --git a/src/Connection/PhpiredisSocketConnection.php b/src/Connection/PhpiredisSocketConnection.php index 602e9cb6..9de4ca3a 100644 --- a/src/Connection/PhpiredisSocketConnection.php +++ b/src/Connection/PhpiredisSocketConnection.php @@ -11,8 +11,8 @@ namespace Predis\Connection; -use Predis\NotSupportedException; use Predis\Command\CommandInterface; +use Predis\NotSupportedException; use Predis\Response\Error as ErrorResponse; use Predis\Response\Status as StatusResponse; diff --git a/src/Connection/PhpiredisStreamConnection.php b/src/Connection/PhpiredisStreamConnection.php index 6c50644f..74eec7c8 100644 --- a/src/Connection/PhpiredisStreamConnection.php +++ b/src/Connection/PhpiredisStreamConnection.php @@ -11,8 +11,8 @@ namespace Predis\Connection; -use Predis\NotSupportedException; use Predis\Command\CommandInterface; +use Predis\NotSupportedException; use Predis\Response\Error as ErrorResponse; use Predis\Response\Status as StatusResponse; diff --git a/src/Connection/WebdisConnection.php b/src/Connection/WebdisConnection.php index e4c8aef4..56a90bb4 100644 --- a/src/Connection/WebdisConnection.php +++ b/src/Connection/WebdisConnection.php @@ -11,8 +11,8 @@ namespace Predis\Connection; -use Predis\NotSupportedException; use Predis\Command\CommandInterface; +use Predis\NotSupportedException; use Predis\Protocol\ProtocolException; use Predis\Response\Error as ErrorResponse; use Predis\Response\Status as StatusResponse; @@ -219,9 +219,9 @@ class WebdisConnection implements NodeConnectionInterface * * @param CommandInterface $command Command instance. * + * @throws NotSupportedException * @return string * - * @throws NotSupportedException */ protected function getCommandId(CommandInterface $command) { diff --git a/src/Monitor/Consumer.php b/src/Monitor/Consumer.php index 55555e02..d10bad1a 100644 --- a/src/Monitor/Consumer.php +++ b/src/Monitor/Consumer.php @@ -12,8 +12,8 @@ namespace Predis\Monitor; use Predis\ClientInterface; -use Predis\NotSupportedException; use Predis\Connection\AggregateConnectionInterface; +use Predis\NotSupportedException; /** * Redis MONITOR consumer. diff --git a/src/Pipeline/ConnectionErrorProof.php b/src/Pipeline/ConnectionErrorProof.php index bcd03197..d3bc732e 100644 --- a/src/Pipeline/ConnectionErrorProof.php +++ b/src/Pipeline/ConnectionErrorProof.php @@ -11,11 +11,11 @@ namespace Predis\Pipeline; -use Predis\NotSupportedException; use Predis\CommunicationException; +use Predis\Connection\Aggregate\ClusterInterface; use Predis\Connection\ConnectionInterface; use Predis\Connection\NodeConnectionInterface; -use Predis\Connection\Aggregate\ClusterInterface; +use Predis\NotSupportedException; /** * Command pipeline that does not throw exceptions on connection errors, but diff --git a/src/Pipeline/Pipeline.php b/src/Pipeline/Pipeline.php index 499c91db..acaefe72 100644 --- a/src/Pipeline/Pipeline.php +++ b/src/Pipeline/Pipeline.php @@ -15,8 +15,8 @@ use Predis\ClientContextInterface; use Predis\ClientException; use Predis\ClientInterface; use Predis\Command\CommandInterface; -use Predis\Connection\ConnectionInterface; use Predis\Connection\Aggregate\ReplicationInterface; +use Predis\Connection\ConnectionInterface; use Predis\Response\ErrorInterface as ErrorResponseInterface; use Predis\Response\ResponseInterface; use Predis\Response\ServerException; @@ -192,10 +192,10 @@ class Pipeline implements ClientContextInterface * * @param mixed $callable Optional callback for execution. * - * @return array - * * @throws \Exception * @throws \InvalidArgumentException + * @return array + * */ public function execute($callable = null) { diff --git a/src/Profile/Factory.php b/src/Profile/Factory.php index dc055c53..b1ff7fa0 100644 --- a/src/Profile/Factory.php +++ b/src/Profile/Factory.php @@ -83,9 +83,9 @@ final class Factory * * @param string $version Profile version or alias. * - * @return ProfileInterface - * * @throws ClientException + * + * @return ProfileInterface */ public static function get($version) { diff --git a/src/Protocol/Text/Handler/StreamableMultiBulkResponse.php b/src/Protocol/Text/Handler/StreamableMultiBulkResponse.php index 50b11ec0..7cdb736a 100644 --- a/src/Protocol/Text/Handler/StreamableMultiBulkResponse.php +++ b/src/Protocol/Text/Handler/StreamableMultiBulkResponse.php @@ -13,8 +13,8 @@ namespace Predis\Protocol\Text\Handler; use Predis\CommunicationException; use Predis\Connection\CompositeConnectionInterface; -use Predis\Response\Iterator\MultiBulk as MultiBulkIterator; use Predis\Protocol\ProtocolException; +use Predis\Response\Iterator\MultiBulk as MultiBulkIterator; /** * Handler for the multibulk response type in the standard Redis wire protocol. diff --git a/src/Protocol/Text/ProtocolProcessor.php b/src/Protocol/Text/ProtocolProcessor.php index 45c0da13..f04c3ed5 100644 --- a/src/Protocol/Text/ProtocolProcessor.php +++ b/src/Protocol/Text/ProtocolProcessor.php @@ -11,14 +11,14 @@ namespace Predis\Protocol\Text; -use Predis\CommunicationException; use Predis\Command\CommandInterface; +use Predis\CommunicationException; use Predis\Connection\CompositeConnectionInterface; use Predis\Protocol\ProtocolException; use Predis\Protocol\ProtocolProcessorInterface; -use Predis\Response\Status as StatusResponse; use Predis\Response\Error as ErrorResponse; use Predis\Response\Iterator\MultiBulk as MultiBulkIterator; +use Predis\Response\Status as StatusResponse; /** * Protocol processor for the standard Redis wire protocol. diff --git a/src/PubSub/Consumer.php b/src/PubSub/Consumer.php index ae945318..5f2d8a8b 100644 --- a/src/PubSub/Consumer.php +++ b/src/PubSub/Consumer.php @@ -14,8 +14,8 @@ namespace Predis\PubSub; use Predis\ClientException; use Predis\ClientInterface; use Predis\Command\Command; -use Predis\NotSupportedException; use Predis\Connection\AggregateConnectionInterface; +use Predis\NotSupportedException; /** * PUB/SUB consumer abstraction. diff --git a/src/Replication/ReplicationStrategy.php b/src/Replication/ReplicationStrategy.php index 2a279624..41a601da 100644 --- a/src/Replication/ReplicationStrategy.php +++ b/src/Replication/ReplicationStrategy.php @@ -11,8 +11,8 @@ namespace Predis\Replication; -use Predis\NotSupportedException; use Predis\Command\CommandInterface; +use Predis\NotSupportedException; /** * Defines a strategy for master/slave replication. @@ -41,9 +41,9 @@ class ReplicationStrategy * * @param CommandInterface $command Command instance. * + * @throws NotSupportedException * @return bool * - * @throws NotSupportedException */ public function isReadOperation(CommandInterface $command) { diff --git a/src/Transaction/MultiExec.php b/src/Transaction/MultiExec.php index 09f36f60..957f83ea 100644 --- a/src/Transaction/MultiExec.php +++ b/src/Transaction/MultiExec.php @@ -14,14 +14,14 @@ namespace Predis\Transaction; use Predis\ClientContextInterface; use Predis\ClientException; use Predis\ClientInterface; +use Predis\Command\CommandInterface; use Predis\CommunicationException; +use Predis\Connection\AggregateConnectionInterface; use Predis\NotSupportedException; +use Predis\Protocol\ProtocolException; use Predis\Response\ErrorInterface as ErrorResponseInterface; use Predis\Response\ServerException; use Predis\Response\Status as StatusResponse; -use Predis\Command\CommandInterface; -use Predis\Connection\AggregateConnectionInterface; -use Predis\Protocol\ProtocolException; /** * Client-side abstraction of a Redis transaction based on MULTI / EXEC. @@ -168,9 +168,9 @@ class MultiExec implements ClientContextInterface * @param string $commandID Command ID. * @param array $arguments Arguments for the command. * + * @throws ServerException * @return mixed * - * @throws ServerException */ protected function call($commandID, array $arguments = array()) { @@ -190,10 +190,10 @@ class MultiExec implements ClientContextInterface * * @param CommandInterface $command Command instance. * - * @return $this|mixed - * * @throws AbortedMultiExecException * @throws CommunicationException + * @return $this|mixed + * */ public function executeCommand(CommandInterface $command) { @@ -221,10 +221,10 @@ class MultiExec implements ClientContextInterface * * @param string|array $keys One or more keys. * - * @return mixed - * * @throws NotSupportedException * @throws ClientException + * @return mixed + * */ public function watch($keys) { @@ -262,9 +262,9 @@ class MultiExec implements ClientContextInterface /** * Executes UNWATCH. * + * @throws NotSupportedException * @return MultiExec * - * @throws NotSupportedException */ public function unwatch() { @@ -350,11 +350,11 @@ class MultiExec implements ClientContextInterface * * @param mixed $callable Optional callback for execution. * - * @return array - * * @throws CommunicationException * @throws AbortedMultiExecException * @throws ServerException + * @return array + * */ public function execute($callable = null) { diff --git a/tests/PHPUnit/PredisCommandTestCase.php b/tests/PHPUnit/PredisCommandTestCase.php index 53396cb2..b4036279 100644 --- a/tests/PHPUnit/PredisCommandTestCase.php +++ b/tests/PHPUnit/PredisCommandTestCase.php @@ -11,9 +11,9 @@ namespace Predis\Command; -use PredisTestCase; use Predis\Client; use Predis\Profile; +use PredisTestCase; /** * diff --git a/tests/PHPUnit/PredisConnectionTestCase.php b/tests/PHPUnit/PredisConnectionTestCase.php index c059aa25..5c60af5b 100644 --- a/tests/PHPUnit/PredisConnectionTestCase.php +++ b/tests/PHPUnit/PredisConnectionTestCase.php @@ -11,8 +11,8 @@ namespace Predis\Connection; -use PredisTestCase; use Predis\Profile; +use PredisTestCase; /** * @group realm-connection diff --git a/tests/PHPUnit/PredisProfileTestCase.php b/tests/PHPUnit/PredisProfileTestCase.php index d8618cd8..27b103b2 100644 --- a/tests/PHPUnit/PredisProfileTestCase.php +++ b/tests/PHPUnit/PredisProfileTestCase.php @@ -11,9 +11,9 @@ namespace Predis\Profile; -use PredisTestCase; use Predis\Command\CommandInterface; use Predis\Command\Processor\ProcessorChain; +use PredisTestCase; /** * diff --git a/tests/PHPUnit/PredisTestCase.php b/tests/PHPUnit/PredisTestCase.php index 3d5bab05..bdbb75bd 100644 --- a/tests/PHPUnit/PredisTestCase.php +++ b/tests/PHPUnit/PredisTestCase.php @@ -182,9 +182,9 @@ abstract class PredisTestCase extends \PHPUnit_Framework_TestCase /** * Returns the server version of the Redis instance used by the test suite. * + * @throws RuntimeException When the client cannot retrieve the current server version * @return string * - * @throws RuntimeException When the client cannot retrieve the current server version */ protected function getRedisServerVersion() { diff --git a/tests/Predis/Cluster/PredisStrategyTest.php b/tests/Predis/Cluster/PredisStrategyTest.php index 259c88fe..820a1489 100644 --- a/tests/Predis/Cluster/PredisStrategyTest.php +++ b/tests/Predis/Cluster/PredisStrategyTest.php @@ -11,8 +11,8 @@ namespace Predis\Cluster; -use PredisTestCase; use Predis\Profile; +use PredisTestCase; /** * diff --git a/tests/Predis/Cluster/RedisStrategyTest.php b/tests/Predis/Cluster/RedisStrategyTest.php index 5ca071a0..fcbdef75 100644 --- a/tests/Predis/Cluster/RedisStrategyTest.php +++ b/tests/Predis/Cluster/RedisStrategyTest.php @@ -11,8 +11,8 @@ namespace Predis\Cluster; -use PredisTestCase; use Predis\Profile; +use PredisTestCase; /** * diff --git a/tests/Predis/Collection/Iterator/HashKeyTest.php b/tests/Predis/Collection/Iterator/HashKeyTest.php index 15a25b03..bf9939d4 100644 --- a/tests/Predis/Collection/Iterator/HashKeyTest.php +++ b/tests/Predis/Collection/Iterator/HashKeyTest.php @@ -11,8 +11,8 @@ namespace Predis\Collection\Iterator; -use PredisTestCase; use Predis\Profile; +use PredisTestCase; /** * @group realm-iterators diff --git a/tests/Predis/Collection/Iterator/KeyspaceTest.php b/tests/Predis/Collection/Iterator/KeyspaceTest.php index 58ce08a2..0bf01ae1 100644 --- a/tests/Predis/Collection/Iterator/KeyspaceTest.php +++ b/tests/Predis/Collection/Iterator/KeyspaceTest.php @@ -11,8 +11,8 @@ namespace Predis\Collection\Iterator; -use PredisTestCase; use Predis\Profile; +use PredisTestCase; /** * @group realm-iterators diff --git a/tests/Predis/Collection/Iterator/ListKeyTest.php b/tests/Predis/Collection/Iterator/ListKeyTest.php index c1898f95..0eb8648d 100644 --- a/tests/Predis/Collection/Iterator/ListKeyTest.php +++ b/tests/Predis/Collection/Iterator/ListKeyTest.php @@ -11,8 +11,8 @@ namespace Predis\Collection\Iterator; -use PredisTestCase; use Predis\Profile; +use PredisTestCase; /** * @group realm-iterators diff --git a/tests/Predis/Collection/Iterator/SetKeyTest.php b/tests/Predis/Collection/Iterator/SetKeyTest.php index fa9e3971..57037ec7 100644 --- a/tests/Predis/Collection/Iterator/SetKeyTest.php +++ b/tests/Predis/Collection/Iterator/SetKeyTest.php @@ -11,8 +11,8 @@ namespace Predis\Collection\Iterator; -use PredisTestCase; use Predis\Profile; +use PredisTestCase; /** * @group realm-iterators diff --git a/tests/Predis/Collection/Iterator/SortedSetKeyTest.php b/tests/Predis/Collection/Iterator/SortedSetKeyTest.php index cc91dd79..ca3deaf2 100644 --- a/tests/Predis/Collection/Iterator/SortedSetKeyTest.php +++ b/tests/Predis/Collection/Iterator/SortedSetKeyTest.php @@ -11,8 +11,8 @@ namespace Predis\Collection\Iterator; -use PredisTestCase; use Predis\Profile; +use PredisTestCase; /** * @group realm-iterators diff --git a/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php b/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php index 15c7dac1..0f415cd8 100644 --- a/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php +++ b/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php @@ -11,8 +11,8 @@ namespace Predis\Command\Processor; -use PredisTestCase; use Predis\Command\RawCommand; +use PredisTestCase; /** * diff --git a/tests/Predis/Command/ZSetReverseRangeByLexTest.php b/tests/Predis/Command/ZSetReverseRangeByLexTest.php index ee794245..3a0e0f82 100644 --- a/tests/Predis/Command/ZSetReverseRangeByLexTest.php +++ b/tests/Predis/Command/ZSetReverseRangeByLexTest.php @@ -3,6 +3,8 @@ /* * This file is part of the Predis package. * + * (c) Daniele Alessandri + * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ diff --git a/tests/Predis/Configuration/ProfileOptionTest.php b/tests/Predis/Configuration/ProfileOptionTest.php index a2fde40e..639d8e12 100644 --- a/tests/Predis/Configuration/ProfileOptionTest.php +++ b/tests/Predis/Configuration/ProfileOptionTest.php @@ -11,9 +11,9 @@ namespace Predis\Configuration; -use PredisTestCase; use Predis\Command\Processor\KeyPrefixProcessor; use Predis\Profile; +use PredisTestCase; /** * diff --git a/tests/Predis/Connection/Aggregate/MasterSlaveReplicationTest.php b/tests/Predis/Connection/Aggregate/MasterSlaveReplicationTest.php index 7e9c68e9..b2f5cdff 100644 --- a/tests/Predis/Connection/Aggregate/MasterSlaveReplicationTest.php +++ b/tests/Predis/Connection/Aggregate/MasterSlaveReplicationTest.php @@ -11,10 +11,10 @@ namespace Predis\Connection\Aggregate; -use PredisTestCase; use Predis\Connection; use Predis\Profile; use Predis\Replication\ReplicationStrategy; +use PredisTestCase; /** * diff --git a/tests/Predis/Connection/Aggregate/PredisClusterTest.php b/tests/Predis/Connection/Aggregate/PredisClusterTest.php index 814c318a..ef826e10 100644 --- a/tests/Predis/Connection/Aggregate/PredisClusterTest.php +++ b/tests/Predis/Connection/Aggregate/PredisClusterTest.php @@ -11,9 +11,9 @@ namespace Predis\Connection\Aggregate; -use PredisTestCase; use Predis\Connection; use Predis\Profile; +use PredisTestCase; /** * diff --git a/tests/Predis/Connection/Aggregate/RedisClusterTest.php b/tests/Predis/Connection/Aggregate/RedisClusterTest.php index 14f0901a..b041760e 100644 --- a/tests/Predis/Connection/Aggregate/RedisClusterTest.php +++ b/tests/Predis/Connection/Aggregate/RedisClusterTest.php @@ -11,11 +11,11 @@ namespace Predis\Connection\Aggregate; -use PredisTestCase; use Predis\Command; use Predis\Connection; use Predis\Profile; use Predis\Response; +use PredisTestCase; /** * diff --git a/tests/Predis/Connection/WebdisConnectionTest.php b/tests/Predis/Connection/WebdisConnectionTest.php index 5607b42c..21dc1b4f 100644 --- a/tests/Predis/Connection/WebdisConnectionTest.php +++ b/tests/Predis/Connection/WebdisConnectionTest.php @@ -11,8 +11,8 @@ namespace Predis\Connection; -use PredisTestCase; use Predis\Profile; +use PredisTestCase; /** * @group ext-curl diff --git a/tests/Predis/Monitor/ConsumerTest.php b/tests/Predis/Monitor/ConsumerTest.php index f300cee4..7b893839 100644 --- a/tests/Predis/Monitor/ConsumerTest.php +++ b/tests/Predis/Monitor/ConsumerTest.php @@ -11,10 +11,10 @@ namespace Predis\Monitor; -use PredisTestCase; use Predis\Client; -use Predis\Profile; use Predis\Monitor\Consumer as MonitorConsumer; +use Predis\Profile; +use PredisTestCase; /** * @group realm-monitor diff --git a/tests/Predis/Pipeline/AtomicTest.php b/tests/Predis/Pipeline/AtomicTest.php index a93f8bb6..36dc4a96 100644 --- a/tests/Predis/Pipeline/AtomicTest.php +++ b/tests/Predis/Pipeline/AtomicTest.php @@ -11,9 +11,9 @@ namespace Predis\Pipeline; -use PredisTestCase; use Predis\Client; use Predis\Response; +use PredisTestCase; /** * diff --git a/tests/Predis/Pipeline/FireAndForgetTest.php b/tests/Predis/Pipeline/FireAndForgetTest.php index 6886a496..ecfc1f50 100644 --- a/tests/Predis/Pipeline/FireAndForgetTest.php +++ b/tests/Predis/Pipeline/FireAndForgetTest.php @@ -11,8 +11,8 @@ namespace Predis\Pipeline; -use PredisTestCase; use Predis\Client; +use PredisTestCase; /** * diff --git a/tests/Predis/Pipeline/PipelineTest.php b/tests/Predis/Pipeline/PipelineTest.php index 14c3a350..1b17f2ef 100644 --- a/tests/Predis/Pipeline/PipelineTest.php +++ b/tests/Predis/Pipeline/PipelineTest.php @@ -11,11 +11,11 @@ namespace Predis\Pipeline; -use PredisTestCase; use Predis\Client; use Predis\ClientException; use Predis\Profile; use Predis\Response; +use PredisTestCase; /** * diff --git a/tests/Predis/PubSub/ConsumerTest.php b/tests/Predis/PubSub/ConsumerTest.php index dbcd4cbd..5ffc5dd0 100644 --- a/tests/Predis/PubSub/ConsumerTest.php +++ b/tests/Predis/PubSub/ConsumerTest.php @@ -11,10 +11,10 @@ namespace Predis\PubSub; -use PredisTestCase; use Predis\Client; use Predis\Profile; use Predis\PubSub\Consumer as PubSubConsumer; +use PredisTestCase; /** * @group realm-pubsub diff --git a/tests/Predis/PubSub/DispatcherLoopTest.php b/tests/Predis/PubSub/DispatcherLoopTest.php index df94c355..3845d29a 100644 --- a/tests/Predis/PubSub/DispatcherLoopTest.php +++ b/tests/Predis/PubSub/DispatcherLoopTest.php @@ -11,8 +11,8 @@ namespace Predis\PubSub; -use PredisTestCase; use Predis\Client; +use PredisTestCase; /** * @group realm-pubsub diff --git a/tests/Predis/Replication/ReplicationStrategyTest.php b/tests/Predis/Replication/ReplicationStrategyTest.php index 5f4684b2..6c7f31d1 100644 --- a/tests/Predis/Replication/ReplicationStrategyTest.php +++ b/tests/Predis/Replication/ReplicationStrategyTest.php @@ -11,8 +11,8 @@ namespace Predis\Replication; -use PredisTestCase; use Predis\Profile; +use PredisTestCase; /** * diff --git a/tests/Predis/Response/Iterator/MultiBulkTest.php b/tests/Predis/Response/Iterator/MultiBulkTest.php index 23cd5403..471ce803 100644 --- a/tests/Predis/Response/Iterator/MultiBulkTest.php +++ b/tests/Predis/Response/Iterator/MultiBulkTest.php @@ -11,10 +11,10 @@ namespace Predis\Response\Iterator; -use PredisTestCase; use Predis\Client; use Predis\Connection\CompositeStreamConnection; use Predis\Protocol\Text\ProtocolProcessor as TextProtocolProcessor; +use PredisTestCase; /** * @group realm-iterators diff --git a/tests/Predis/Response/Iterator/MultiBulkTupleTest.php b/tests/Predis/Response/Iterator/MultiBulkTupleTest.php index bbcadb2b..b7a99226 100644 --- a/tests/Predis/Response/Iterator/MultiBulkTupleTest.php +++ b/tests/Predis/Response/Iterator/MultiBulkTupleTest.php @@ -11,10 +11,10 @@ namespace Predis\Response\Iterator; -use PredisTestCase; use Predis\Client; use Predis\Connection\CompositeStreamConnection; use Predis\Protocol\Text\ProtocolProcessor as TextProtocolProcessor; +use PredisTestCase; /** * @group realm-iterators diff --git a/tests/Predis/Transaction/AbortedMultiExecExceptionTest.php b/tests/Predis/Transaction/AbortedMultiExecExceptionTest.php index 6240ef1d..0fa38a28 100644 --- a/tests/Predis/Transaction/AbortedMultiExecExceptionTest.php +++ b/tests/Predis/Transaction/AbortedMultiExecExceptionTest.php @@ -11,8 +11,8 @@ namespace Predis\Transaction; -use PredisTestCase; use Predis\Client; +use PredisTestCase; /** * diff --git a/tests/Predis/Transaction/MultiExecTest.php b/tests/Predis/Transaction/MultiExecTest.php index e880bf9c..bfdf57aa 100644 --- a/tests/Predis/Transaction/MultiExecTest.php +++ b/tests/Predis/Transaction/MultiExecTest.php @@ -11,10 +11,10 @@ namespace Predis\Transaction; -use PredisTestCase; use Predis\Client; use Predis\Command\CommandInterface; use Predis\Response; +use PredisTestCase; /** * @group realm-transaction