Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Run php-cs-fixer with new configuration.
  • Loading branch information
nrk committed Jul 24, 2015
1 parent 35e9796 commit 8dd9893
Show file tree
Hide file tree
Showing 59 changed files with 93 additions and 89 deletions.
6 changes: 3 additions & 3 deletions examples/custom_cluster_distributor.php
Expand Up @@ -15,9 +15,9 @@
// 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
Expand All @@ -34,7 +34,7 @@ public function __construct()
public function add($node, $weight = null)
{
$this->nodes[] = $node;
$this->nodesCount++;
++$this->nodesCount;
}

public function remove($node)
Expand Down Expand Up @@ -99,7 +99,7 @@ public function getHashGenerator()

$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");
}
Expand Down
4 changes: 2 additions & 2 deletions examples/executing_redis_commands.php
Expand Up @@ -26,7 +26,7 @@
$mkv = array(
'uid:0001' => '1st user',
'uid:0002' => '2nd user',
'uid:0003' => '3rd user'
'uid:0003' => '3rd user',
);

$client->mset($mkv);
Expand All @@ -45,7 +45,7 @@
// 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;
Expand Down
2 changes: 1 addition & 1 deletion examples/lua_scripting_abstraction.php
Expand Up @@ -55,7 +55,7 @@ public function getScript()
$profile->defineCommand('increxby', 'IncrementExistingKeysBy');

return $profile;
}
},
));

$client->mset('foo', 10, 'foobar', 100);
Expand Down
2 changes: 1 addition & 1 deletion examples/monitor_consumer.php
Expand Up @@ -28,7 +28,7 @@
// 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;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/pubsub_consumer.php
Expand Up @@ -36,7 +36,7 @@
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;
Expand Down
2 changes: 1 addition & 1 deletion examples/redis_collections_iterators.php
Expand Up @@ -34,7 +34,7 @@

// 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");
Expand Down
2 changes: 1 addition & 1 deletion examples/replication_complex.php
Expand Up @@ -81,5 +81,5 @@ public function getScript()
$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);
2 changes: 1 addition & 1 deletion examples/session_handler.php
Expand Up @@ -25,7 +25,7 @@
//

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");
}

Expand Down
2 changes: 1 addition & 1 deletion examples/shared.php
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion examples/transaction_using_cas.php
Expand Up @@ -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;
12 changes: 6 additions & 6 deletions src/Client.php
Expand Up @@ -16,8 +16,8 @@
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;
Expand Down Expand Up @@ -64,9 +64,9 @@ public function __construct($parameters = null, $options = null)
*
* @param mixed $options Client options.
*
* @throws \InvalidArgumentException
* @return OptionsInterface
*
* @throws \InvalidArgumentException
*/
protected function createOptions($options)
{
Expand Down Expand Up @@ -96,9 +96,9 @@ protected function createOptions($options)
*
* @param mixed $parameters Connection parameters or connection instance.
*
* @throws \InvalidArgumentException
* @return ConnectionInterface
*
* @throws \InvalidArgumentException
*/
protected function createConnection($parameters)
{
Expand Down Expand Up @@ -189,9 +189,9 @@ public function getOptions()
*
* @param string $connectionID Identifier of a connection.
*
* @throws \InvalidArgumentException
* @return Client
*
* @throws \InvalidArgumentException
*/
public function getClientFor($connectionID)
{
Expand Down Expand Up @@ -253,9 +253,9 @@ public function getConnection()
*
* @param string $connectionID Index or alias of the single connection.
*
* @throws NotSupportedException
* @return Connection\NodeConnectionInterface
*
* @throws NotSupportedException
*/
public function getConnectionById($connectionID)
{
Expand Down Expand Up @@ -342,9 +342,9 @@ public function executeCommand(CommandInterface $command)
* @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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Cluster/RedisStrategy.php
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/Command/ZSetReverseRangeByLex.php
Expand Up @@ -3,6 +3,8 @@
/*
* This file is part of the Predis package.
*
* (c) Daniele Alessandri <suppakilla@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Connection/AbstractConnection.php
Expand Up @@ -11,8 +11,8 @@

namespace Predis\Connection;

use Predis\CommunicationException;
use Predis\Command\CommandInterface;
use Predis\CommunicationException;
use Predis\Protocol\ProtocolException;

/**
Expand Down Expand Up @@ -51,9 +51,9 @@ public function __destruct()
*
* @param ParametersInterface $parameters Initialization parameters for the connection.
*
* @throws \InvalidArgumentException
* @return ParametersInterface
*
* @throws \InvalidArgumentException
*/
protected function assertParameters(ParametersInterface $parameters)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Connection/Aggregate/PredisCluster.php
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/Connection/Aggregate/RedisCluster.php
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -313,9 +313,9 @@ public function getConnection(CommandInterface $command)
*
* @param int $slot Slot index.
*
* @throws \OutOfBoundsException
* @return NodeConnectionInterface
*
* @throws \OutOfBoundsException
*/
public function getConnectionBySlot($slot)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Connection/Factory.php
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Connection/Parameters.php
Expand Up @@ -69,9 +69,9 @@ public static function create($parameters)
*
* @param string $uri URI string.
*
* @throws \InvalidArgumentException
* @return array
*
* @throws \InvalidArgumentException
*/
public static function parse($uri)
{
Expand Down Expand Up @@ -111,9 +111,9 @@ public static function parse($uri)
*
* @param string $uri URI string.
*
* @throws \InvalidArgumentException
* @return array
*
* @throws \InvalidArgumentException
*/
public static function parseIANA($uri)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Connection/PhpiredisSocketConnection.php
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/Connection/PhpiredisStreamConnection.php
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/Connection/WebdisConnection.php
Expand Up @@ -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;
Expand Down Expand Up @@ -219,9 +219,9 @@ public function isConnected()
*
* @param CommandInterface $command Command instance.
*
* @throws NotSupportedException
* @return string
*
* @throws NotSupportedException
*/
protected function getCommandId(CommandInterface $command)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Monitor/Consumer.php
Expand Up @@ -12,8 +12,8 @@
namespace Predis\Monitor;

use Predis\ClientInterface;
use Predis\NotSupportedException;
use Predis\Connection\AggregateConnectionInterface;
use Predis\NotSupportedException;

/**
* Redis MONITOR consumer.
Expand Down
4 changes: 2 additions & 2 deletions src/Pipeline/ConnectionErrorProof.php
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/Pipeline/Pipeline.php
Expand Up @@ -15,8 +15,8 @@
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;
Expand Down Expand Up @@ -192,10 +192,10 @@ private function setRunning($bool)
*
* @param mixed $callable Optional callback for execution.
*
* @return array
*
* @throws \Exception
* @throws \InvalidArgumentException
* @return array
*
*/
public function execute($callable = null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Profile/Factory.php
Expand Up @@ -83,9 +83,9 @@ public static function define($alias, $class)
*
* @param string $version Profile version or alias.
*
* @return ProfileInterface
*
* @throws ClientException
*
* @return ProfileInterface
*/
public static function get($version)
{
Expand Down

0 comments on commit 8dd9893

Please sign in to comment.