diff --git a/src/Client.php b/src/Client.php index e49b005f..e78213ea 100644 --- a/src/Client.php +++ b/src/Client.php @@ -64,7 +64,8 @@ class Client implements ClientInterface * types of arguments or simply returns the passed argument if it is an * instance of Predis\Configuration\OptionsInterface. * - * @param mixed $options Client options. + * @param mixed $options Client options. + * * @return OptionsInterface */ protected function createOptions($options) @@ -93,7 +94,8 @@ class Client implements ClientInterface * - String * - Callable * - * @param mixed $parameters Connection parameters or connection instance. + * @param mixed $parameters Connection parameters or connection instance. + * * @return ConnectionInterface */ protected function createConnection($parameters) @@ -143,7 +145,8 @@ class Client implements ClientInterface * Wraps a callable to make sure that its returned value represents a valid * connection type. * - * @param mixed $callable + * @param mixed $callable + * * @return \Closure */ protected function getConnectionInitializerWrapper($callable) @@ -182,7 +185,8 @@ class Client implements ClientInterface * only when working with an aggregate connection (cluster, replication). * The new client instances uses the same options of the original one. * - * @param string $connectionID Identifier of a connection. + * @param string $connectionID Identifier of a connection. + * * @return Client */ public function getClientFor($connectionID) @@ -243,7 +247,8 @@ class Client implements ClientInterface * Retrieves the specified connection from the aggregate connection when the * client is in cluster or replication mode. * - * @param string $connectionID Index or alias of the single connection. + * @param string $connectionID Index or alias of the single connection. + * * @return Connection\NodeConnectionInterface * * @throws NotSupportedException @@ -267,8 +272,9 @@ class Client implements ClientInterface * It is possibile to indentify Redis error responses from normal responses * using the second optional argument which is populated by reference. * - * @param array $arguments Command arguments as defined by the command signature. - * @param bool $error Set to TRUE when Redis returned an error response. + * @param array $arguments Command arguments as defined by the command signature. + * @param bool $error Set to TRUE when Redis returned an error response. + * * @return mixed */ public function executeRaw(array $arguments, &$error = null) @@ -329,8 +335,9 @@ class Client implements ClientInterface /** * Handles -ERR responses returned by Redis. * - * @param CommandInterface $command Redis command that generated the error. - * @param ErrorResponseInterface $response Instance of the error response. + * @param CommandInterface $command Redis command that generated the error. + * @param ErrorResponseInterface $response Instance of the error response. + * * @return mixed * * @throws ServerException @@ -363,8 +370,9 @@ class Client implements ClientInterface * simply an utility method to create Redis contexts instances since they * follow a common initialization path. * - * @param string $initializer Method name. - * @param array $argv Arguments for the method. + * @param string $initializer Method name. + * @param array $argv Arguments for the method. + * * @return mixed */ private function sharedContextFactory($initializer, $argv = null) @@ -392,7 +400,8 @@ class Client implements ClientInterface * Creates a new pipeline context and returns it, or returns the results of * a pipeline executed inside the optionally provided callable object. * - * @param mixed ... Array of options, a callable for execution, or both. + * @param mixed ... Array of options, a callable for execution, or both. + * * @return Pipeline|array */ public function pipeline(/* arguments */) @@ -403,8 +412,9 @@ class Client implements ClientInterface /** * Actual pipeline context initializer method. * - * @param array $options Options for the context. - * @param mixed $callable Optional callable used to execute the context. + * @param array $options Options for the context. + * @param mixed $callable Optional callable used to execute the context. + * * @return Pipeline|array */ protected function createPipeline(array $options = null, $callable = null) @@ -433,7 +443,8 @@ class Client implements ClientInterface * Creates a new transaction context and returns it, or returns the results * of a transaction executed inside the optionally provided callable object. * - * @param mixed ... Array of options, a callable for execution, or both. + * @param mixed ... Array of options, a callable for execution, or both. + * * @return MultiExecTransaction|array */ public function transaction(/* arguments */) @@ -444,8 +455,9 @@ class Client implements ClientInterface /** * Actual transaction context initializer method. * - * @param array $options Options for the context. - * @param mixed $callable Optional callable used to execute the context. + * @param array $options Options for the context. + * @param mixed $callable Optional callable used to execute the context. + * * @return MultiExecTransaction|array */ protected function createTransaction(array $options = null, $callable = null) @@ -463,7 +475,8 @@ class Client implements ClientInterface * Creates a new publis/subscribe context and returns it, or starts its loop * inside the optionally provided callable object. * - * @param mixed ... Array of options, a callable for execution, or both. + * @param mixed ... Array of options, a callable for execution, or both. + * * @return PubSubConsumer|NULL */ public function pubSubLoop(/* arguments */) @@ -474,8 +487,9 @@ class Client implements ClientInterface /** * Actual publish/subscribe context initializer method. * - * @param array $options Options for the context. - * @param mixed $callable Optional callable used to execute the context. + * @param array $options Options for the context. + * @param mixed $callable Optional callable used to execute the context. + * * @return PubSubConsumer|NULL */ protected function createPubSub(array $options = null, $callable = null) diff --git a/src/ClientContextInterface.php b/src/ClientContextInterface.php index 0203211e..63b77d7d 100644 --- a/src/ClientContextInterface.php +++ b/src/ClientContextInterface.php @@ -162,7 +162,8 @@ interface ClientContextInterface /** * Sends the specified command instance to Redis. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return mixed */ public function executeCommand(CommandInterface $command); @@ -170,8 +171,9 @@ interface ClientContextInterface /** * Sends the specified command with its arguments to Redis. * - * @param string $method Command ID. - * @param array $arguments Arguments for the command. + * @param string $method Command ID. + * @param array $arguments Arguments for the command. + * * @return mixed */ public function __call($method, $arguments); @@ -179,7 +181,8 @@ interface ClientContextInterface /** * Starts the execution of the context. * - * @param mixed $callable Optional callback for execution. + * @param mixed $callable Optional callback for execution. + * * @return array */ public function execute($callable = null); diff --git a/src/ClientInterface.php b/src/ClientInterface.php index 0b628afa..42a2856b 100644 --- a/src/ClientInterface.php +++ b/src/ClientInterface.php @@ -200,8 +200,9 @@ interface ClientInterface /** * Creates a new instance of the specified Redis command. * - * @param string $method Command ID. - * @param array $arguments Arguments for the command. + * @param string $method Command ID. + * @param array $arguments Arguments for the command. + * * @return CommandInterface */ public function createCommand($method, $arguments = array()); @@ -209,7 +210,8 @@ interface ClientInterface /** * Executes the specified Redis command. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return mixed */ public function executeCommand(CommandInterface $command); @@ -218,8 +220,9 @@ interface ClientInterface * Creates a Redis command with the specified arguments and sends a request * to the server. * - * @param string $method Command ID. - * @param array $arguments Arguments for the command. + * @param string $method Command ID. + * @param array $arguments Arguments for the command. + * * @return mixed */ public function __call($method, $arguments); diff --git a/src/Cluster/ClusterStrategy.php b/src/Cluster/ClusterStrategy.php index 2a9c19b0..8e7351f7 100644 --- a/src/Cluster/ClusterStrategy.php +++ b/src/Cluster/ClusterStrategy.php @@ -210,7 +210,8 @@ abstract class ClusterStrategy implements StrategyInterface /** * Extracts the key from the first argument of a command instance. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return string */ protected function getKeyFromFirstArgument(CommandInterface $command) @@ -222,7 +223,8 @@ abstract class ClusterStrategy implements StrategyInterface * Extracts the key from a command with multiple keys only when all keys in * the arguments array produce the same hash. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return string */ protected function getKeyFromAllArguments(CommandInterface $command) @@ -240,7 +242,8 @@ abstract class ClusterStrategy implements StrategyInterface * Extracts the key from a command with multiple keys only when all keys in * the arguments array produce the same hash. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return string */ protected function getKeyFromInterleavedArguments(CommandInterface $command) @@ -262,7 +265,8 @@ abstract class ClusterStrategy implements StrategyInterface /** * Extracts the key from BLPOP and BRPOP commands. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return string */ protected function getKeyFromBlockingListCommands(CommandInterface $command) @@ -279,7 +283,8 @@ abstract class ClusterStrategy implements StrategyInterface /** * Extracts the key from BITOP command. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return string */ protected function getKeyFromBitOp(CommandInterface $command) @@ -296,7 +301,8 @@ abstract class ClusterStrategy implements StrategyInterface /** * Extracts the key from ZINTERSTORE and ZUNIONSTORE commands. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return string */ protected function getKeyFromZsetAggregationCommands(CommandInterface $command) @@ -314,7 +320,8 @@ abstract class ClusterStrategy implements StrategyInterface /** * Extracts the key from EVAL and EVALSHA commands. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return string */ protected function getKeyFromScriptingCommands(CommandInterface $command) @@ -359,7 +366,8 @@ abstract class ClusterStrategy implements StrategyInterface /** * Checks if the specified array of keys will generate the same hash. * - * @param array $keys Array of keys. + * @param array $keys Array of keys. + * * @return bool */ protected function checkSameSlotForKeys(array $keys) @@ -387,7 +395,8 @@ abstract class ClusterStrategy implements StrategyInterface * Returns only the hashable part of a key (delimited by "{...}"), or the * whole key if a key tag is not found in the string. * - * @param string $key A key. + * @param string $key A key. + * * @return string */ protected function extractKeyTag($key) diff --git a/src/Cluster/Distributor/DistributorInterface.php b/src/Cluster/Distributor/DistributorInterface.php index 4322be8c..a5c8198b 100644 --- a/src/Cluster/Distributor/DistributorInterface.php +++ b/src/Cluster/Distributor/DistributorInterface.php @@ -40,7 +40,8 @@ interface DistributorInterface * Returns the corresponding slot of a node from the distributor using the * computed hash of a key. * - * @param mixed $hash + * @param mixed $hash + * * @return mixed */ public function getSlot($hash); @@ -48,7 +49,8 @@ interface DistributorInterface /** * Returns a node from the distributor using its assigned slot ID. * - * @param mixed $slot + * @param mixed $slot + * * @return mixed */ public function getBySlot($slot); @@ -56,7 +58,8 @@ interface DistributorInterface /** * Returns a node from the distributor using the computed hash of a key. * - * @param mixed $hash + * @param mixed $hash + * * @return mixed */ public function getByHash($hash); @@ -64,7 +67,8 @@ interface DistributorInterface /** * Returns a node from the distributor mapping to the specified value. * - * @param string $value + * @param string $value + * * @return mixed */ public function get($value); diff --git a/src/Cluster/Distributor/HashRing.php b/src/Cluster/Distributor/HashRing.php index 198f334a..38792442 100644 --- a/src/Cluster/Distributor/HashRing.php +++ b/src/Cluster/Distributor/HashRing.php @@ -249,9 +249,10 @@ class HashRing implements DistributorInterface, HashGeneratorInterface /** * Implements a strategy to deal with wrap-around errors during binary searches. * - * @param int $upper - * @param int $lower - * @param int $ringKeysCount + * @param int $upper + * @param int $lower + * @param int $ringKeysCount + * * @return int */ protected function wrapAroundStrategy($upper, $lower, $ringKeysCount) diff --git a/src/Cluster/Hash/HashGeneratorInterface.php b/src/Cluster/Hash/HashGeneratorInterface.php index f54266a7..271b9e72 100644 --- a/src/Cluster/Hash/HashGeneratorInterface.php +++ b/src/Cluster/Hash/HashGeneratorInterface.php @@ -22,7 +22,8 @@ interface HashGeneratorInterface /** * Generates an hash from a string to be used for distribution. * - * @param string $value String value. + * @param string $value String value. + * * @return int */ public function hash($value); diff --git a/src/Cluster/StrategyInterface.php b/src/Cluster/StrategyInterface.php index a31a1d05..cdf7d09f 100644 --- a/src/Cluster/StrategyInterface.php +++ b/src/Cluster/StrategyInterface.php @@ -28,7 +28,8 @@ interface StrategyInterface * Returns a slot for the given command used for clustering distribution or * NULL when this is not possible. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return int */ public function getSlot(CommandInterface $command); @@ -37,7 +38,8 @@ interface StrategyInterface * Returns a slot for the given key used for clustering distribution or NULL * when this is not possible. * - * @param string $key Key string. + * @param string $key Key string. + * * @return int */ public function getSlotByKey($key); diff --git a/src/Command/Command.php b/src/Command/Command.php index b36343d1..7cc14230 100644 --- a/src/Command/Command.php +++ b/src/Command/Command.php @@ -24,7 +24,8 @@ abstract class Command implements CommandInterface /** * Returns a filtered array of the arguments. * - * @param array $arguments List of arguments. + * @param array $arguments List of arguments. + * * @return array */ protected function filterArguments(array $arguments) @@ -101,7 +102,8 @@ abstract class Command implements CommandInterface /** * Normalizes the arguments array passed to a Redis command. * - * @param array $arguments Arguments for a command. + * @param array $arguments Arguments for a command. + * * @return array */ public static function normalizeArguments(array $arguments) @@ -116,7 +118,8 @@ abstract class Command implements CommandInterface /** * Normalizes the arguments array passed to a variadic Redis command. * - * @param array $arguments Arguments for a command. + * @param array $arguments Arguments for a command. + * * @return array */ public static function normalizeVariadic(array $arguments) diff --git a/src/Command/CommandInterface.php b/src/Command/CommandInterface.php index 545a6968..a0deb70d 100644 --- a/src/Command/CommandInterface.php +++ b/src/Command/CommandInterface.php @@ -64,7 +64,8 @@ interface CommandInterface /** * Gets the argument of the command at the specified index. * - * @param int $index Index of the desired argument. + * @param int $index Index of the desired argument. + * * @return mixed */ public function getArgument($index); @@ -72,7 +73,8 @@ interface CommandInterface /** * Parses a raw response and returns a PHP object. * - * @param string $data Binary string containing the whole response. + * @param string $data Binary string containing the whole response. + * * @return mixed */ public function parseResponse($data); diff --git a/src/Command/HashScan.php b/src/Command/HashScan.php index c9ff3fcb..371f1de2 100644 --- a/src/Command/HashScan.php +++ b/src/Command/HashScan.php @@ -41,7 +41,8 @@ class HashScan extends Command /** * Returns a list of options and modifiers compatible with Redis. * - * @param array $options List of options. + * @param array $options List of options. + * * @return array */ protected function prepareOptions($options) diff --git a/src/Command/KeyScan.php b/src/Command/KeyScan.php index 0ecf2184..7604b677 100644 --- a/src/Command/KeyScan.php +++ b/src/Command/KeyScan.php @@ -41,7 +41,8 @@ class KeyScan extends Command /** * Returns a list of options and modifiers compatible with Redis. * - * @param array $options List of options. + * @param array $options List of options. + * * @return array */ protected function prepareOptions($options) diff --git a/src/Command/PubSubPubsub.php b/src/Command/PubSubPubsub.php index 76ea5194..12ad116a 100644 --- a/src/Command/PubSubPubsub.php +++ b/src/Command/PubSubPubsub.php @@ -42,7 +42,8 @@ class PubSubPubsub extends Command /** * Returns the processed response to PUBSUB NUMSUB. * - * @param array $channels List of channels + * @param array $channels List of channels + * * @return array */ protected static function processNumsub(array $channels) diff --git a/src/Command/RawCommand.php b/src/Command/RawCommand.php index 0fbb8d07..dc5d0eaf 100644 --- a/src/Command/RawCommand.php +++ b/src/Command/RawCommand.php @@ -29,6 +29,9 @@ class RawCommand implements CommandInterface private $commandID; private $arguments; + /** + * @param array $arguments Command ID and its arguments. + */ public function __construct(array $arguments) { if (!$arguments) { @@ -44,8 +47,9 @@ class RawCommand implements CommandInterface /** * Creates a new raw command using a variadic method. * - * @param string $commandID Redis command ID. - * @param string ... Arguments list for the command. + * @param string $commandID Redis command ID. + * @param string ... Arguments list for the command. + * * @return CommandInterface */ public static function create($commandID /* [ $arg, ... */) diff --git a/src/Command/ServerClient.php b/src/Command/ServerClient.php index 287dfc11..a30f53f0 100644 --- a/src/Command/ServerClient.php +++ b/src/Command/ServerClient.php @@ -49,7 +49,8 @@ class ServerClient extends Command /** * Parses the response to CLIENT LIST and returns a structured list. * - * @param string $data Response buffer. + * @param string $data Response buffer. + * * @return array */ protected function parseClientList($data) diff --git a/src/Command/ServerInfo.php b/src/Command/ServerInfo.php index cdcec3e5..3cfabd3c 100644 --- a/src/Command/ServerInfo.php +++ b/src/Command/ServerInfo.php @@ -48,7 +48,8 @@ class ServerInfo extends Command /** * Parses a single row of the response and returns the key-value pair. * - * @param string $row Single row of the response. + * @param string $row Single row of the response. + * * @return array */ protected function parseRow($row) @@ -65,7 +66,8 @@ class ServerInfo extends Command /** * Extracts the statistics of each logical DB from the string buffer. * - * @param string $str Response buffer. + * @param string $str Response buffer. + * * @return array */ protected function parseDatabaseStats($str) @@ -83,7 +85,8 @@ class ServerInfo extends Command /** * Parses the response and extracts the allocation statistics. * - * @param string $str Response buffer. + * @param string $str Response buffer. + * * @return array */ protected function parseAllocationStats($str) diff --git a/src/Command/ServerSentinel.php b/src/Command/ServerSentinel.php index eec81649..cbd1ed59 100644 --- a/src/Command/ServerSentinel.php +++ b/src/Command/ServerSentinel.php @@ -43,7 +43,8 @@ class ServerSentinel extends Command /** * Returns a processed response to SENTINEL MASTERS or SENTINEL SLAVES. * - * @param array $servers List of Redis servers. + * @param array $servers List of Redis servers. + * * @return array */ protected static function processMastersOrSlaves(array $servers) diff --git a/src/Command/SetScan.php b/src/Command/SetScan.php index 28771dd6..bb36fb7a 100644 --- a/src/Command/SetScan.php +++ b/src/Command/SetScan.php @@ -41,7 +41,8 @@ class SetScan extends Command /** * Returns a list of options and modifiers compatible with Redis. * - * @param array $options List of options. + * @param array $options List of options. + * * @return array */ protected function prepareOptions($options) diff --git a/src/Command/ZSetRange.php b/src/Command/ZSetRange.php index 98b8d62d..6e20fc8f 100644 --- a/src/Command/ZSetRange.php +++ b/src/Command/ZSetRange.php @@ -52,7 +52,8 @@ class ZSetRange extends Command /** * Returns a list of options and modifiers compatible with Redis. * - * @param array $options List of options. + * @param array $options List of options. + * * @return array */ protected function prepareOptions($options) diff --git a/src/Command/ZSetScan.php b/src/Command/ZSetScan.php index 6e926dc2..0c3a37e8 100644 --- a/src/Command/ZSetScan.php +++ b/src/Command/ZSetScan.php @@ -41,7 +41,8 @@ class ZSetScan extends Command /** * Returns a list of options and modifiers compatible with Redis. * - * @param array $options List of options. + * @param array $options List of options. + * * @return array */ protected function prepareOptions($options) diff --git a/src/Command/ZSetUnionStore.php b/src/Command/ZSetUnionStore.php index fb96e679..daf858f5 100644 --- a/src/Command/ZSetUnionStore.php +++ b/src/Command/ZSetUnionStore.php @@ -50,7 +50,8 @@ class ZSetUnionStore extends Command /** * Returns a list of options and modifiers compatible with Redis. * - * @param array $options List of options. + * @param array $options List of options. + * * @return array */ private function prepareOptions($options) diff --git a/src/Configuration/ClusterOption.php b/src/Configuration/ClusterOption.php index 415b4132..d7ff9834 100644 --- a/src/Configuration/ClusterOption.php +++ b/src/Configuration/ClusterOption.php @@ -28,8 +28,9 @@ class ClusterOption implements OptionInterface /** * Creates a new cluster connection from on a known descriptive name. * - * @param OptionsInterface $options Instance of the client options. - * @param string $id Descriptive identifier of the cluster type (`predis`, `redis-cluster`) + * @param OptionsInterface $options Instance of the client options. + * @param string $id Descriptive identifier of the cluster type (`predis`, `redis-cluster`) + * * @return ClusterInterface */ protected function createByDescription(OptionsInterface $options, $id) diff --git a/src/Configuration/OptionInterface.php b/src/Configuration/OptionInterface.php index e728376e..b31e0c98 100644 --- a/src/Configuration/OptionInterface.php +++ b/src/Configuration/OptionInterface.php @@ -22,8 +22,9 @@ interface OptionInterface /** * Filters and validates the passed value. * - * @param OptionsInterface $options Options container. - * @param mixed $value Input value. + * @param OptionsInterface $options Options container. + * @param mixed $value Input value. + * * @return mixed */ public function filter(OptionsInterface $options, $value); @@ -31,7 +32,8 @@ interface OptionInterface /** * Returns the default value for the option. * - * @param OptionsInterface $options Options container. + * @param OptionsInterface $options Options container. + * * @return mixed */ public function getDefault(OptionsInterface $options); diff --git a/src/Configuration/OptionsInterface.php b/src/Configuration/OptionsInterface.php index bd529687..f3051156 100644 --- a/src/Configuration/OptionsInterface.php +++ b/src/Configuration/OptionsInterface.php @@ -29,7 +29,8 @@ interface OptionsInterface /** * Returns the default value for the given option. * - * @param string $option Name of the option. + * @param string $option Name of the option. + * * @return mixed */ public function getDefault($option); @@ -37,7 +38,8 @@ interface OptionsInterface /** * Checks if the given option has been set by the user upon initialization. * - * @param string $option Name of the option. + * @param string $option Name of the option. + * * @return bool */ public function defined($option); @@ -45,7 +47,8 @@ interface OptionsInterface /** * Checks if the given option has been set and does not evaluate to NULL. * - * @param string $option Name of the option. + * @param string $option Name of the option. + * * @return bool */ public function __isset($option); @@ -53,7 +56,8 @@ interface OptionsInterface /** * Returns the value of the given option. * - * @param string $option Name of the option. + * @param string $option Name of the option. + * * @return mixed */ public function __get($option); diff --git a/src/Connection/AbstractConnection.php b/src/Connection/AbstractConnection.php index e22cf4f1..6807b31d 100644 --- a/src/Connection/AbstractConnection.php +++ b/src/Connection/AbstractConnection.php @@ -50,7 +50,8 @@ abstract class AbstractConnection implements NodeConnectionInterface /** * Checks some of the parameters used to initialize the connection. * - * @param ParametersInterface $parameters Initialization parameters for the connection. + * @param ParametersInterface $parameters Initialization parameters for the connection. + * * @return ParametersInterface */ protected function assertParameters(ParametersInterface $parameters) diff --git a/src/Connection/Aggregate/PredisCluster.php b/src/Connection/Aggregate/PredisCluster.php index d61bcbbc..d67621c8 100644 --- a/src/Connection/Aggregate/PredisCluster.php +++ b/src/Connection/Aggregate/PredisCluster.php @@ -112,8 +112,9 @@ class PredisCluster implements ClusterInterface, IteratorAggregate, Countable /** * Removes a connection instance using its alias or index. * - * @param string $connectionID Alias or index of a connection. - * @return bool Returns true if the connection was in the pool. + * @param string $connectionID Alias or index of a connection. + * + * @return bool Returns true if the connection was in the pool. */ public function removeById($connectionID) { @@ -153,7 +154,8 @@ class PredisCluster implements ClusterInterface, IteratorAggregate, Countable /** * Retrieves a connection instance from the cluster using a key. * - * @param string $key Key string. + * @param string $key Key string. + * * @return NodeConnectionInterface */ public function getConnectionByKey($key) @@ -218,7 +220,8 @@ class PredisCluster implements ClusterInterface, IteratorAggregate, Countable /** * Executes the specified Redis command on all the nodes of a cluster. * - * @param CommandInterface $command A Redis command. + * @param CommandInterface $command A Redis command. + * * @return array */ public function executeCommandOnNodes(CommandInterface $command) diff --git a/src/Connection/Aggregate/RedisCluster.php b/src/Connection/Aggregate/RedisCluster.php index 77892e22..15395edb 100644 --- a/src/Connection/Aggregate/RedisCluster.php +++ b/src/Connection/Aggregate/RedisCluster.php @@ -131,8 +131,9 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable /** * Removes a connection instance by using its identifier. * - * @param string $connectionID Connection identifier. - * @return bool True if the connection was in the pool. + * @param string $connectionID Connection identifier. + * + * @return bool True if the connection was in the pool. */ public function removeById($connectionID) { @@ -178,7 +179,8 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable * the CLUSTER SLOTS command against the specified node or a random one from * the pool. * - * @param NodeConnectionInterface $connection Optional connection instance. + * @param NodeConnectionInterface $connection Optional connection instance. + * * @return array */ public function askSlotsMap(NodeConnectionInterface $connection = null) @@ -246,7 +248,8 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable * slots map, falling back to the same logic used by Redis to initialize a * cluster (best-effort). * - * @param int $slot Slot index. + * @param int $slot Slot index. + * * @return string Connection ID. */ protected function guessNode($slot) @@ -269,7 +272,8 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable /** * Creates a new connection instance from the given connection ID. * - * @param string $connectionID Identifier for the connection. + * @param string $connectionID Identifier for the connection. + * * @return NodeConnectionInterface */ protected function createConnection($connectionID) @@ -309,7 +313,8 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable /** * Returns the connection currently associated to a given slot. * - * @param int $slot Slot index. + * @param int $slot Slot index. + * * @return NodeConnectionInterface */ public function getConnectionBySlot($slot) @@ -374,8 +379,9 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable /** * Handles -ERR responses returned by Redis. * - * @param CommandInterface $command Command that generated the -ERR response. - * @param ErrorResponseInterface $error Redis error response object. + * @param CommandInterface $command Command that generated the -ERR response. + * @param ErrorResponseInterface $error Redis error response object. + * * @return mixed */ protected function onErrorResponse(CommandInterface $command, ErrorResponseInterface $error) @@ -398,8 +404,9 @@ class RedisCluster implements ClusterInterface, IteratorAggregate, Countable * Handles -MOVED responses by executing again the command against the node * indicated by the Redis response. * - * @param CommandInterface $command Command that generated the -MOVED response. - * @param string $details Parameters of the -MOVED response. + * @param CommandInterface $command Command that generated the -MOVED response. + * @param string $details Parameters of the -MOVED response. + * * @return mixed */ protected function onMovedResponse(CommandInterface $command, $details) diff --git a/src/Connection/AggregateConnectionInterface.php b/src/Connection/AggregateConnectionInterface.php index d42c15da..670f8240 100644 --- a/src/Connection/AggregateConnectionInterface.php +++ b/src/Connection/AggregateConnectionInterface.php @@ -31,15 +31,17 @@ interface AggregateConnectionInterface extends ConnectionInterface /** * Removes the specified connection instance from the aggregate connection. * - * @param NodeConnectionInterface $connection Connection instance. - * @return bool Returns true if the connection was in the pool. + * @param NodeConnectionInterface $connection Connection instance. + * + * @return bool Returns true if the connection was in the pool. */ public function remove(NodeConnectionInterface $connection); /** * Returns the connection instance in charge for the given command. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return NodeConnectionInterface */ public function getConnection(CommandInterface $command); @@ -47,7 +49,8 @@ interface AggregateConnectionInterface extends ConnectionInterface /** * Returns a connection instance from the aggregate connection by its alias. * - * @param string $connectionID Connection alias. + * @param string $connectionID Connection alias. + * * @return NodeConnectionInterface */ public function getConnectionById($connectionID); diff --git a/src/Connection/CompositeConnectionInterface.php b/src/Connection/CompositeConnectionInterface.php index db4bb353..286e082c 100644 --- a/src/Connection/CompositeConnectionInterface.php +++ b/src/Connection/CompositeConnectionInterface.php @@ -35,6 +35,7 @@ interface CompositeConnectionInterface extends NodeConnectionInterface * Reads the given number of bytes from the connection. * * @param int $length Number of bytes to read from the connection. + * * @return string */ public function readBuffer($length); diff --git a/src/Connection/ConnectionInterface.php b/src/Connection/ConnectionInterface.php index 98181701..11ace1b6 100644 --- a/src/Connection/ConnectionInterface.php +++ b/src/Connection/ConnectionInterface.php @@ -48,7 +48,8 @@ interface ConnectionInterface /** * Reads the response to the given command from the connection. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return mixed */ public function readResponse(CommandInterface $command); @@ -57,7 +58,8 @@ interface ConnectionInterface * Writes a request for the given command over the connection and reads back * the response returned by Redis. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return mixed */ public function executeCommand(CommandInterface $command); diff --git a/src/Connection/Factory.php b/src/Connection/Factory.php index 49d723aa..2ce1a798 100644 --- a/src/Connection/Factory.php +++ b/src/Connection/Factory.php @@ -34,7 +34,8 @@ class Factory implements FactoryInterface * implementing Predis\Connection\NodeConnectionInterface. Optionally, * callable objects are used for lazy initialization of connection objects. * - * @param mixed $initializer FQN of a connection class or a callable for lazy initialization. + * @param mixed $initializer FQN of a connection class or a callable for lazy initialization. + * * @return mixed */ protected function checkInitializer($initializer) @@ -117,7 +118,8 @@ class Factory implements FactoryInterface /** * Creates a connection parameters instance from the supplied argument. * - * @param mixed $parameters Original connection parameters. + * @param mixed $parameters Original connection parameters. + * * @return ParametersInterface */ protected function createParameters($parameters) diff --git a/src/Connection/FactoryInterface.php b/src/Connection/FactoryInterface.php index 16602157..2bae0839 100644 --- a/src/Connection/FactoryInterface.php +++ b/src/Connection/FactoryInterface.php @@ -36,7 +36,8 @@ interface FactoryInterface /** * Creates a new connection object. * - * @param mixed $parameters Initialization parameters for the connection. + * @param mixed $parameters Initialization parameters for the connection. + * * @return NodeConnectionInterface */ public function create($parameters); diff --git a/src/Connection/Parameters.php b/src/Connection/Parameters.php index fa30a388..8062f354 100644 --- a/src/Connection/Parameters.php +++ b/src/Connection/Parameters.php @@ -53,7 +53,8 @@ class Parameters implements ParametersInterface * Creates a new instance by supplying the initial parameters either in the * form of an URI string or a named array. * - * @param array|string $parameters Set of connection parameters. + * @param array|string $parameters Set of connection parameters. + * * @return Parameters */ public static function create($parameters) @@ -68,7 +69,8 @@ class Parameters implements ParametersInterface /** * Parses an URI string returning an array of connection parameters. * - * @param string $uri URI string. + * @param string $uri URI string. + * * @return array */ public static function parse($uri) @@ -95,7 +97,8 @@ class Parameters implements ParametersInterface /** * Validates and converts each value of the connection parameters array. * - * @param array $parameters Connection parameters. + * @param array $parameters Connection parameters. + * * @return array */ protected function filter(array $parameters) diff --git a/src/Connection/ParametersInterface.php b/src/Connection/ParametersInterface.php index 5ec10bf0..5ed0ab67 100644 --- a/src/Connection/ParametersInterface.php +++ b/src/Connection/ParametersInterface.php @@ -38,7 +38,8 @@ interface ParametersInterface /** * Checks if the specified parameters is set. * - * @param string $parameter Name of the parameter. + * @param string $parameter Name of the parameter. + * * @return bool */ public function __isset($parameter); @@ -46,7 +47,8 @@ interface ParametersInterface /** * Returns the value of the specified parameter. * - * @param string $parameter Name of the parameter. + * @param string $parameter Name of the parameter. + * * @return mixed */ public function __get($parameter); diff --git a/src/Connection/PhpiredisSocketConnection.php b/src/Connection/PhpiredisSocketConnection.php index b6f3443e..daf58545 100644 --- a/src/Connection/PhpiredisSocketConnection.php +++ b/src/Connection/PhpiredisSocketConnection.php @@ -226,7 +226,8 @@ class PhpiredisSocketConnection extends AbstractConnection /** * Gets the address from the connection parameters. * - * @param ParametersInterface $parameters Parameters used to initialize the connection. + * @param ParametersInterface $parameters Parameters used to initialize the connection. + * * @return string */ protected static function getAddress(ParametersInterface $parameters) @@ -251,7 +252,8 @@ class PhpiredisSocketConnection extends AbstractConnection /** * Opens the actual connection to the server with a timeout. * - * @param ParametersInterface $parameters Parameters used to initialize the connection. + * @param ParametersInterface $parameters Parameters used to initialize the connection. + * * @return string */ private function connectWithTimeout(ParametersInterface $parameters) diff --git a/src/Connection/StreamConnection.php b/src/Connection/StreamConnection.php index dc779d6e..087b8d68 100644 --- a/src/Connection/StreamConnection.php +++ b/src/Connection/StreamConnection.php @@ -61,7 +61,8 @@ class StreamConnection extends AbstractConnection /** * Initializes a TCP stream resource. * - * @param ParametersInterface $parameters Initialization parameters for the connection. + * @param ParametersInterface $parameters Initialization parameters for the connection. + * * @return resource */ protected function tcpStreamInitializer(ParametersInterface $parameters) @@ -103,7 +104,8 @@ class StreamConnection extends AbstractConnection /** * Initializes a UNIX stream resource. * - * @param ParametersInterface $parameters Initialization parameters for the connection. + * @param ParametersInterface $parameters Initialization parameters for the connection. + * * @return resource */ protected function unixStreamInitializer(ParametersInterface $parameters) diff --git a/src/Connection/WebdisConnection.php b/src/Connection/WebdisConnection.php index dbdb4a2b..d056aa03 100644 --- a/src/Connection/WebdisConnection.php +++ b/src/Connection/WebdisConnection.php @@ -176,8 +176,9 @@ class WebdisConnection implements NodeConnectionInterface /** * Feeds the phpredis reader resource with the data read from the network. * - * @param resource $resource Reader resource. - * @param string $buffer Buffer of data read from a connection. + * @param resource $resource Reader resource. + * @param string $buffer Buffer of data read from a connection. + * * @return int */ protected function feedReader($resource, $buffer) @@ -214,7 +215,8 @@ class WebdisConnection implements NodeConnectionInterface /** * Checks if the specified command is supported by this connection class. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return string * * @throws NotSupportedException diff --git a/src/Monitor/Consumer.php b/src/Monitor/Consumer.php index 60bebd7f..eab2a86c 100644 --- a/src/Monitor/Consumer.php +++ b/src/Monitor/Consumer.php @@ -124,7 +124,7 @@ class Consumer implements Iterator /** * Checks if the the consumer is still in a valid state to continue. * - * @return Boolean + * @return bool */ public function valid() { diff --git a/src/Pipeline/Pipeline.php b/src/Pipeline/Pipeline.php index ecdba8e0..05b02673 100644 --- a/src/Pipeline/Pipeline.php +++ b/src/Pipeline/Pipeline.php @@ -52,8 +52,9 @@ class Pipeline implements ClientContextInterface /** * Queues a command into the pipeline buffer. * - * @param string $method Command ID. - * @param array $arguments Arguments for the command. + * @param string $method Command ID. + * @param array $arguments Arguments for the command. + * * @return $this */ public function __call($method, $arguments) @@ -77,7 +78,8 @@ class Pipeline implements ClientContextInterface /** * Queues a command instance into the pipeline buffer. * - * @param CommandInterface $command Command instance to be queued in the buffer. + * @param CommandInterface $command Command instance to be queued in the buffer. + * * @return $this */ public function executeCommand(CommandInterface $command) @@ -123,8 +125,9 @@ class Pipeline implements ClientContextInterface * Implements the logic to flush the queued commands and read the responses * from the current connection. * - * @param ConnectionInterface $connection Current connection instance. - * @param SplQueue $commands Queued commands. + * @param ConnectionInterface $connection Current connection instance. + * @param SplQueue $commands Queued commands. + * * @return array */ protected function executePipeline(ConnectionInterface $connection, SplQueue $commands) @@ -155,7 +158,8 @@ class Pipeline implements ClientContextInterface /** * Flushes the buffer holding all of the commands queued so far. * - * @param bool $send Specifies if the commands in the buffer should be sent to Redis. + * @param bool $send Specifies if the commands in the buffer should be sent to Redis. + * * @return $this */ public function flushPipeline($send = true) @@ -189,8 +193,8 @@ class Pipeline implements ClientContextInterface /** * Handles the actual execution of the whole pipeline. * - * @param mixed $callable Optional callback for execution. - * @throws null + * @param mixed $callable Optional callback for execution. + * * @return array * * @throws Exception @@ -227,7 +231,6 @@ class Pipeline implements ClientContextInterface /** * Returns if the pipeline should throw exceptions on server errors. * - * @todo Awful naming... * @return bool */ protected function throwServerExceptions() diff --git a/src/Profile/Factory.php b/src/Profile/Factory.php index 9b543975..949f73b5 100644 --- a/src/Profile/Factory.php +++ b/src/Profile/Factory.php @@ -81,7 +81,8 @@ final class Factory /** * Returns the specified server profile. * - * @param string $version Profile version or alias. + * @param string $version Profile version or alias. + * * @return ProfileInterface * * @throws ClientException diff --git a/src/Profile/ProfileInterface.php b/src/Profile/ProfileInterface.php index 07386fe3..6f875a07 100644 --- a/src/Profile/ProfileInterface.php +++ b/src/Profile/ProfileInterface.php @@ -32,15 +32,17 @@ interface ProfileInterface /** * Checks if the profile supports the specified command. * - * @param string $commandID Command ID. - * @return Boolean + * @param string $commandID Command ID. + * + * @return bool */ public function supportsCommand($commandID); /** * Checks if the profile supports the specified list of commands. * - * @param array $commandIDs List of command IDs. + * @param array $commandIDs List of command IDs. + * * @return string */ public function supportsCommands(array $commandIDs); @@ -48,8 +50,9 @@ interface ProfileInterface /** * Creates a new command instance. * - * @param string $commandID Command ID. - * @param array $arguments Arguments for the command. + * @param string $commandID Command ID. + * @param array $arguments Arguments for the command. + * * @return CommandInterface */ public function createCommand($commandID, $arguments = array()); diff --git a/src/Profile/RedisProfile.php b/src/Profile/RedisProfile.php index 59a4744a..1e68f447 100644 --- a/src/Profile/RedisProfile.php +++ b/src/Profile/RedisProfile.php @@ -68,7 +68,8 @@ abstract class RedisProfile implements ProfileInterface * Returns the fully-qualified name of a class representing the specified * command ID registered in the current server profile. * - * @param string $commandID Command ID. + * @param string $commandID Command ID. + * * @return string */ public function getCommandClass($commandID) diff --git a/src/Protocol/ProtocolProcessorInterface.php b/src/Protocol/ProtocolProcessorInterface.php index d0845a21..b34ea181 100644 --- a/src/Protocol/ProtocolProcessorInterface.php +++ b/src/Protocol/ProtocolProcessorInterface.php @@ -33,7 +33,8 @@ interface ProtocolProcessorInterface /** * Reads a response from a connection to Redis. * - * @param CompositeConnectionInterface $connection Redis connection. + * @param CompositeConnectionInterface $connection Redis connection. + * * @return mixed */ public function read(CompositeConnectionInterface $connection); diff --git a/src/Protocol/RequestSerializerInterface.php b/src/Protocol/RequestSerializerInterface.php index bcfb4561..eef72a64 100644 --- a/src/Protocol/RequestSerializerInterface.php +++ b/src/Protocol/RequestSerializerInterface.php @@ -23,7 +23,8 @@ interface RequestSerializerInterface /** * Serializes a Redis command. * - * @param CommandInterface $command Redis command. + * @param CommandInterface $command Redis command. + * * @return string */ public function serialize(CommandInterface $command); diff --git a/src/Protocol/ResponseReaderInterface.php b/src/Protocol/ResponseReaderInterface.php index 5ead1d6f..86a7bdcc 100644 --- a/src/Protocol/ResponseReaderInterface.php +++ b/src/Protocol/ResponseReaderInterface.php @@ -24,7 +24,8 @@ interface ResponseReaderInterface /** * Reads a response from a connection to Redis. * - * @param CompositeConnectionInterface $connection Redis connection. + * @param CompositeConnectionInterface $connection Redis connection. + * * @return mixed */ public function read(CompositeConnectionInterface $connection); diff --git a/src/Protocol/Text/Handler/ResponseHandlerInterface.php b/src/Protocol/Text/Handler/ResponseHandlerInterface.php index 29316da8..ca08a9c5 100644 --- a/src/Protocol/Text/Handler/ResponseHandlerInterface.php +++ b/src/Protocol/Text/Handler/ResponseHandlerInterface.php @@ -24,8 +24,9 @@ interface ResponseHandlerInterface * Deserializes a response returned by Redis and reads more data from the * connection if needed. * - * @param CompositeConnectionInterface $connection Redis connection. - * @param string $payload String payload. + * @param CompositeConnectionInterface $connection Redis connection. + * @param string $payload String payload. + * * @return mixed */ public function handle(CompositeConnectionInterface $connection, $payload); diff --git a/src/Protocol/Text/ResponseReader.php b/src/Protocol/Text/ResponseReader.php index 51264381..1543aa03 100644 --- a/src/Protocol/Text/ResponseReader.php +++ b/src/Protocol/Text/ResponseReader.php @@ -64,7 +64,8 @@ class ResponseReader implements ResponseReaderInterface /** * Returns the response handler associated to a certain type of response. * - * @param string $prefix Identifier of the type of response. + * @param string $prefix Identifier of the type of response. + * * @return Handler\ResponseHandlerInterface */ public function getHandler($prefix) diff --git a/src/PubSub/AbstractConsumer.php b/src/PubSub/AbstractConsumer.php index 98c1b48e..19cfa1dc 100644 --- a/src/PubSub/AbstractConsumer.php +++ b/src/PubSub/AbstractConsumer.php @@ -46,8 +46,9 @@ abstract class AbstractConsumer implements Iterator /** * Checks if the specified flag is valid based on the state of the consumer. * - * @param int $value Flag. - * @return Boolean + * @param int $value Flag. + * + * @return bool */ protected function isFlagSet($value) { @@ -111,7 +112,8 @@ abstract class AbstractConsumer implements Iterator * Closes the context by unsubscribing from all the subscribed channels. The * context can be forcefully closed by dropping the underlying connection. * - * @param bool $drop Indicates if the context should be closed by dropping the connection. + * @param bool $drop Indicates if the context should be closed by dropping the connection. + * * @return bool Returns false when there are no pending messages. */ public function stop($drop = false) @@ -190,7 +192,7 @@ abstract class AbstractConsumer implements Iterator /** * Checks if the the consumer is still in a valid state to continue. * - * @return Boolean + * @return bool */ public function valid() { diff --git a/src/Replication/ReplicationStrategy.php b/src/Replication/ReplicationStrategy.php index 952ab615..169cd8c0 100644 --- a/src/Replication/ReplicationStrategy.php +++ b/src/Replication/ReplicationStrategy.php @@ -39,7 +39,8 @@ class ReplicationStrategy * Returns if the specified command will perform a read-only operation * on Redis or not. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return bool * * @throws NotSupportedException @@ -79,7 +80,8 @@ class ReplicationStrategy * Returns if the specified command is not allowed for execution in a master * / slave replication context. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return bool */ public function isDisallowedOperation(CommandInterface $command) @@ -91,7 +93,8 @@ class ReplicationStrategy * Checks if a SORT command is a readable operation by parsing the arguments * array of the specified commad instance. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return bool */ protected function isSortReadOnly(CommandInterface $command) diff --git a/src/Response/Status.php b/src/Response/Status.php index 31dd391f..729bb663 100644 --- a/src/Response/Status.php +++ b/src/Response/Status.php @@ -57,7 +57,8 @@ class Status implements ResponseInterface * Common status responses such as OK or QUEUED are cached in order to lower * the global memory usage especially when using pipelines. * - * @param string $payload Status response payload. + * @param string $payload Status response payload. + * * @return string */ public static function get($payload) diff --git a/src/Transaction/MultiExec.php b/src/Transaction/MultiExec.php index 35735ba6..fb8abe49 100644 --- a/src/Transaction/MultiExec.php +++ b/src/Transaction/MultiExec.php @@ -153,8 +153,9 @@ class MultiExec implements ClientContextInterface /** * Dynamically invokes a Redis command with the specified arguments. * - * @param string $method Command ID. - * @param array $arguments Arguments for the command. + * @param string $method Command ID. + * @param array $arguments Arguments for the command. + * * @return mixed */ public function __call($method, $arguments) @@ -168,8 +169,9 @@ class MultiExec implements ClientContextInterface /** * Executes a Redis command bypassing the transaction logic. * - * @param string $commandID Command ID. - * @param array $arguments Arguments for the command. + * @param string $commandID Command ID. + * @param array $arguments Arguments for the command. + * * @return mixed * * @throws ServerException @@ -189,7 +191,8 @@ class MultiExec implements ClientContextInterface /** * Executes the specified Redis command. * - * @param CommandInterface $command Command instance. + * @param CommandInterface $command Command instance. + * * @return $this|mixed * * @throws AbortedMultiExecException @@ -219,7 +222,8 @@ class MultiExec implements ClientContextInterface /** * Executes WATCH against one or more keys. * - * @param string|array $keys One or more keys. + * @param string|array $keys One or more keys. + * * @return mixed * * @throws NotSupportedException @@ -346,7 +350,8 @@ class MultiExec implements ClientContextInterface /** * Handles the actual execution of the whole transaction. * - * @param mixed $callable Optional callback for execution. + * @param mixed $callable Optional callback for execution. + * * @return array * * @throws CommunicationException diff --git a/src/Transaction/MultiExecState.php b/src/Transaction/MultiExecState.php index daddefbb..a0a82852 100644 --- a/src/Transaction/MultiExecState.php +++ b/src/Transaction/MultiExecState.php @@ -77,7 +77,8 @@ class MultiExecState /** * Returns if the specified flag or set of flags is set. * - * @param int $flags Flag + * @param int $flags Flag + * * @return bool */ public function check($flags) diff --git a/tests/PHPUnit/PredisCommandTestCase.php b/tests/PHPUnit/PredisCommandTestCase.php index ac36151f..53396cb2 100644 --- a/tests/PHPUnit/PredisCommandTestCase.php +++ b/tests/PHPUnit/PredisCommandTestCase.php @@ -49,7 +49,8 @@ abstract class PredisCommandTestCase extends PredisTestCase /** * Returns a new client instance. * - * @param bool $flushdb Flush selected database before returning the client. + * @param bool $flushdb Flush selected database before returning the client. + * * @return Client */ public function getClient($flushdb = true) @@ -70,7 +71,7 @@ abstract class PredisCommandTestCase extends PredisTestCase /** * Returns wether the command is prefixable or not. * - * @return Boolean + * @return bool */ protected function isPrefixable() { @@ -81,6 +82,7 @@ abstract class PredisCommandTestCase extends PredisTestCase * Returns a new command instance with the specified arguments. * * @param ... List of arguments for the command. + * * @return CommandInterface */ protected function getCommandWithArguments(/* arguments */) @@ -91,7 +93,8 @@ abstract class PredisCommandTestCase extends PredisTestCase /** * Returns a new command instance with the specified arguments. * - * @param array $arguments Arguments for the command. + * @param array $arguments Arguments for the command. + * * @return CommandInterface */ protected function getCommandWithArgumentsArray(array $arguments) diff --git a/tests/PHPUnit/PredisConnectionTestCase.php b/tests/PHPUnit/PredisConnectionTestCase.php index d9c1b7bc..c059aa25 100644 --- a/tests/PHPUnit/PredisConnectionTestCase.php +++ b/tests/PHPUnit/PredisConnectionTestCase.php @@ -337,9 +337,10 @@ abstract class PredisConnectionTestCase extends PredisTestCase /** * Returns a new instance of a connection instance. * - * @param Profile\ProfileInterface $profile Reference to the server profile instance. - * @param Boolean $initialize Push default initialization commands (SELECT and FLUSHDB). - * @param array $parameters Additional connection parameters. + * @param Profile\ProfileInterface $profile Reference to the server profile instance. + * @param bool $initialize Push default initialization commands (SELECT and FLUSHDB). + * @param array $parameters Additional connection parameters. + * * @return StreamConnection */ abstract protected function getConnection(&$profile = null, $initialize = false, array $parameters = array()); diff --git a/tests/PHPUnit/PredisDistributorTestCase.php b/tests/PHPUnit/PredisDistributorTestCase.php index a010fb98..1ad89345 100644 --- a/tests/PHPUnit/PredisDistributorTestCase.php +++ b/tests/PHPUnit/PredisDistributorTestCase.php @@ -28,9 +28,10 @@ abstract class PredisDistributorTestCase extends PredisTestCase /** * Returns a list of nodes from the hashring. * - * @param DistributorInterface $distributor Distributor instance. - * @param int $iterations Number of nodes to fetch. - * @return array Nodes from the hashring. + * @param DistributorInterface $distributor Distributor instance. + * @param int $iterations Number of nodes to fetch. + * + * @return array Nodes from the hashring. */ protected function getNodes(DistributorInterface $distributor, $iterations = 10) { @@ -47,7 +48,8 @@ abstract class PredisDistributorTestCase extends PredisTestCase /** * Returns a distributor instance with the specified nodes added. * - * @param array $nodes Nodes to add to the distributor. + * @param array $nodes Nodes to add to the distributor. + * * @return DistributorInterface */ protected function getSampleDistribution(array $nodes) diff --git a/tests/PHPUnit/PredisProfileTestCase.php b/tests/PHPUnit/PredisProfileTestCase.php index fc35d187..9bbd8be6 100644 --- a/tests/PHPUnit/PredisProfileTestCase.php +++ b/tests/PHPUnit/PredisProfileTestCase.php @@ -23,7 +23,8 @@ abstract class PredisProfileTestCase extends PredisTestCase /** * Returns a new instance of the tested profile. * - * @param string $version Version of Redis. + * @param string $version Version of Redis. + * * @return ProfileInterface */ protected function getProfile($version = null) @@ -49,7 +50,8 @@ abstract class PredisProfileTestCase extends PredisTestCase * Returns the list of commands supported by the current * server profile. * - * @param ProfileInterface $profile Server profile instance. + * @param ProfileInterface $profile Server profile instance. + * * @return array */ protected function getCommands(ProfileInterface $profile) diff --git a/tests/PHPUnit/PredisTestCase.php b/tests/PHPUnit/PredisTestCase.php index 4b8c86a2..ddb9c7ba 100644 --- a/tests/PHPUnit/PredisTestCase.php +++ b/tests/PHPUnit/PredisTestCase.php @@ -25,8 +25,9 @@ abstract class PredisTestCase extends \PHPUnit_Framework_TestCase * Verifies that a Redis command is a valid Predis\Command\CommandInterface * instance with the specified ID and command arguments. * - * @param string|Command\CommandInterface $command Expected command or command ID. - * @param array $arguments Expected command arguments. + * @param string|Command\CommandInterface $command Expected command or command ID. + * @param array $arguments Expected command arguments. + * * @return RedisCommandConstraint */ public function isRedisCommand($command = null, array $arguments = null) @@ -99,7 +100,8 @@ abstract class PredisTestCase extends \PHPUnit_Framework_TestCase * Returns a named array with the default connection parameters merged with * the specified additional parameters. * - * @param array $additional Additional connection parameters. + * @param array $additional Additional connection parameters. + * * @return array Connection parameters. */ protected function getParametersArray(array $additional) @@ -110,8 +112,9 @@ abstract class PredisTestCase extends \PHPUnit_Framework_TestCase /** * Returns a new instance of connection parameters. * - * @param array $additional Additional connection parameters. - * @return Connection\Parameters Default connection parameters. + * @param array $additional Additional connection parameters. + * + * @return Connection\Parameters */ protected function getParameters($additional = array()) { @@ -124,7 +127,8 @@ abstract class PredisTestCase extends \PHPUnit_Framework_TestCase /** * Returns a new instance of server profile. * - * @param string $version Redis profile. + * @param string $version Redis profile. + * * @return Profile\ProfileInterface */ protected function getProfile($version = null) @@ -135,9 +139,10 @@ abstract class PredisTestCase extends \PHPUnit_Framework_TestCase /** * Returns a new client instance. * - * @param array $parameters Additional connection parameters. - * @param array $options Additional client options. - * @param bool $flushdb Flush selected database before returning the client. + * @param array $parameters Additional connection parameters. + * @param array $options Additional client options. + * @param bool $flushdb Flush selected database before returning the client. + * * @return Client */ protected function createClient(array $parameters = null, array $options = null, $flushdb = true) @@ -168,6 +173,7 @@ abstract class PredisTestCase extends \PHPUnit_Framework_TestCase * Returns the server version of the Redis instance used by the test suite. * * @return string + * * @throws RuntimeException When the client cannot retrieve the current server version */ protected function getRedisServerVersion() @@ -195,10 +201,12 @@ abstract class PredisTestCase extends \PHPUnit_Framework_TestCase } /** - * @param string $expectedVersion Expected redis version. - * @param string $operator Comparison operator. - * @param callable $callback Callback for matching version. + * @param string $expectedVersion Expected redis version. + * @param string $operator Comparison operator. + * @param callable $callback Callback for matching version. + * * @return string + * * @throws \PHPUnit_Framework_SkippedTestError When expected redis version is not met */ protected function executeOnRedisVersion($expectedVersion, $operator, $callback) @@ -214,10 +222,12 @@ abstract class PredisTestCase extends \PHPUnit_Framework_TestCase } /** - * @param string $expectedVersion Expected redis version. - * @param string $operator Comparison operator. - * @param callable $callback Callback for matching version. + * @param string $expectedVersion Expected redis version. + * @param string $operator Comparison operator. + * @param callable $callback Callback for matching version. + * * @return string + * * @throws \PHPUnit_Framework_SkippedTestError When expected redis version is not met */ protected function executeOnProfileVersion($expectedVersion, $operator, $callback) diff --git a/tests/Predis/ClientTest.php b/tests/Predis/ClientTest.php index 7b2f9794..e21d796e 100644 --- a/tests/Predis/ClientTest.php +++ b/tests/Predis/ClientTest.php @@ -824,8 +824,9 @@ class ClientTest extends PredisTestCase /** * Returns an URI string representation of the specified connection parameters. * - * @param array $parameters Array of connection parameters. - * @return String URI string. + * @param array $parameters Array of connection parameters. + * + * @return string URI string. */ protected function getParametersString(array $parameters) { diff --git a/tests/Predis/Cluster/Distributor/HashRingTest.php b/tests/Predis/Cluster/Distributor/HashRingTest.php index b1156dd6..a64d2f19 100644 --- a/tests/Predis/Cluster/Distributor/HashRingTest.php +++ b/tests/Predis/Cluster/Distributor/HashRingTest.php @@ -174,13 +174,6 @@ class HashRingTest extends PredisDistributorTestCase '127.0.0.1:7002', )); -/* -$hash = $ring->hash('uid:641'); -$slot32 = $ring->getSlot($hash); -$slot64 = sprintf("%u", $slot32 & 0xffffffff); -echo "32: $slot32 - 64: $slot64\n"; -exit(); -*/ $this->assertSame('127.0.0.1:7001', $ring->getBySlot(PHP_INT_SIZE == 4 ? -1255075679 : 3039891617)); // uid:256 $this->assertSame('127.0.0.1:7001', $ring->getBySlot(PHP_INT_SIZE == 4 ? -1642314910 : 2652652386)); // uid:281 $this->assertSame('127.0.0.1:7000', $ring->getBySlot(PHP_INT_SIZE == 4 ? -687739295 : 3607228001)); // uid:312 diff --git a/tests/Predis/Cluster/PredisStrategyTest.php b/tests/Predis/Cluster/PredisStrategyTest.php index a9bcde92..42d4db70 100644 --- a/tests/Predis/Cluster/PredisStrategyTest.php +++ b/tests/Predis/Cluster/PredisStrategyTest.php @@ -247,7 +247,8 @@ class PredisStrategyTest extends PredisTestCase /** * Returns the list of expected supported commands. * - * @param string $type Optional type of command (based on its keys) + * @param string $type Optional type of command (based on its keys) + * * @return array */ protected function getExpectedCommands($type = null) diff --git a/tests/Predis/Cluster/RedisStrategyTest.php b/tests/Predis/Cluster/RedisStrategyTest.php index 5c5b8c6c..6a034edd 100644 --- a/tests/Predis/Cluster/RedisStrategyTest.php +++ b/tests/Predis/Cluster/RedisStrategyTest.php @@ -257,7 +257,8 @@ class RedisStrategyTest extends PredisTestCase /** * Returns the list of expected supported commands. * - * @param string $type Optional type of command (based on its keys) + * @param string $type Optional type of command (based on its keys) + * * @return array */ protected function getExpectedCommands($type = null) diff --git a/tests/Predis/CommunicationExceptionTest.php b/tests/Predis/CommunicationExceptionTest.php index 954be22c..fa647f68 100644 --- a/tests/Predis/CommunicationExceptionTest.php +++ b/tests/Predis/CommunicationExceptionTest.php @@ -77,7 +77,8 @@ class CommunicationExceptionTest extends PredisTestCase /** * Returns a mocked connection instance. * - * @param mixed $parameters Connection parameters. + * @param mixed $parameters Connection parameters. + * * @return Connection\NodeConnectionInterface */ protected function getMockedConnectionBase($parameters = null) @@ -96,10 +97,11 @@ class CommunicationExceptionTest extends PredisTestCase /** * Returns a connection exception instance. * - * @param Connection\NodeConnectionInterface $connection Connection instance. - * @param string $message Exception message. - * @param int $code Exception code. - * @param \Exception $inner Inner exception. + * @param Connection\NodeConnectionInterface $connection Connection instance. + * @param string $message Exception message. + * @param int $code Exception code. + * @param \Exception $inner Inner exception. + * * @return \Predis\CommunicationException */ protected function getException( diff --git a/tests/Predis/Connection/Aggregate/MasterSlaveReplicationTest.php b/tests/Predis/Connection/Aggregate/MasterSlaveReplicationTest.php index b8dac930..7e9c68e9 100644 --- a/tests/Predis/Connection/Aggregate/MasterSlaveReplicationTest.php +++ b/tests/Predis/Connection/Aggregate/MasterSlaveReplicationTest.php @@ -570,7 +570,8 @@ class MasterSlaveReplicationTest extends PredisTestCase /** * Returns a base mocked connection from Predis\Connection\NodeConnectionInterface. * - * @param mixed $parameters Optional parameters. + * @param mixed $parameters Optional parameters. + * * @return mixed */ protected function getMockConnection($parameters = null) diff --git a/tests/Predis/Connection/Aggregate/PredisClusterTest.php b/tests/Predis/Connection/Aggregate/PredisClusterTest.php index 05084b4f..814c318a 100644 --- a/tests/Predis/Connection/Aggregate/PredisClusterTest.php +++ b/tests/Predis/Connection/Aggregate/PredisClusterTest.php @@ -405,7 +405,8 @@ class PredisClusterTest extends PredisTestCase /** * Returns a base mocked connection from Predis\Connection\NodeConnectionInterface. * - * @param mixed $parameters Optional parameters. + * @param mixed $parameters Optional parameters. + * * @return mixed */ protected function getMockConnection($parameters = null) diff --git a/tests/Predis/Connection/Aggregate/RedisClusterTest.php b/tests/Predis/Connection/Aggregate/RedisClusterTest.php index 8cc3d043..c848bbd9 100644 --- a/tests/Predis/Connection/Aggregate/RedisClusterTest.php +++ b/tests/Predis/Connection/Aggregate/RedisClusterTest.php @@ -758,7 +758,8 @@ class RedisClusterTest extends PredisTestCase /** * Returns a base mocked connection from Predis\Connection\NodeConnectionInterface. * - * @param mixed $parameters Optional parameters. + * @param mixed $parameters Optional parameters. + * * @return mixed */ protected function getMockConnection($parameters = null) diff --git a/tests/Predis/Connection/ParametersTest.php b/tests/Predis/Connection/ParametersTest.php index 33d6a937..43bc6096 100644 --- a/tests/Predis/Connection/ParametersTest.php +++ b/tests/Predis/Connection/ParametersTest.php @@ -252,8 +252,9 @@ class ParametersTest extends PredisTestCase /** * Returns an URI string representation of the specified connection parameters. * - * @param array $parameters array of connection parameters. - * @return String URI string. + * @param array $parameters array of connection parameters. + * + * @return string URI string. */ protected function getParametersString(array $parameters) { diff --git a/tests/Predis/Connection/WebdisConnectionTest.php b/tests/Predis/Connection/WebdisConnectionTest.php index 4253aaef..c59deae4 100644 --- a/tests/Predis/Connection/WebdisConnectionTest.php +++ b/tests/Predis/Connection/WebdisConnectionTest.php @@ -171,8 +171,9 @@ class WebdisConnectionTest extends PredisTestCase /** * Returns a new instance of a connection instance. * - * @param mixed $profile Redis profile. - * @param array $parameters Additional connection parameters. + * @param mixed $profile Redis profile. + * @param array $parameters Additional connection parameters. + * * @return WebdisConnection */ protected function getConnection(&$profile = null, array $parameters = array()) diff --git a/tests/Predis/Pipeline/PipelineTest.php b/tests/Predis/Pipeline/PipelineTest.php index 77af74d5..492133ad 100644 --- a/tests/Predis/Pipeline/PipelineTest.php +++ b/tests/Predis/Pipeline/PipelineTest.php @@ -487,8 +487,9 @@ class PipelineTest extends PredisTestCase * Returns a client instance connected to the specified Redis * server instance to perform integration tests. * - * @param array $parameters Additional connection parameters. - * @param array $options Additional client options. + * @param array $parameters Additional connection parameters. + * @param array $options Additional client options. + * * @return Client */ protected function getClient(array $parameters = array(), array $options = array()) diff --git a/tests/Predis/Protocol/Text/ProtocolProcessorTest.php b/tests/Predis/Protocol/Text/ProtocolProcessorTest.php index 7d3b3ce6..d43045dc 100644 --- a/tests/Predis/Protocol/Text/ProtocolProcessorTest.php +++ b/tests/Predis/Protocol/Text/ProtocolProcessorTest.php @@ -46,8 +46,9 @@ class ProtocolProcessorTest extends PredisTestCase } /** - * @todo Improve test coverage * @group disconnected + * + * @todo Improve test coverage */ public function testConnectionRead() { diff --git a/tests/Predis/Replication/ReplicationStrategyTest.php b/tests/Predis/Replication/ReplicationStrategyTest.php index 9caad628..befa082e 100644 --- a/tests/Predis/Replication/ReplicationStrategyTest.php +++ b/tests/Predis/Replication/ReplicationStrategyTest.php @@ -232,7 +232,8 @@ class ReplicationStrategyTest extends PredisTestCase /** * Returns the list of expected supported commands. * - * @param string $type Optional type of command (based on its keys) + * @param string $type Optional type of command (based on its keys) + * * @return array */ protected function getExpectedCommands($type = null) diff --git a/tests/Predis/Transaction/MultiExecTest.php b/tests/Predis/Transaction/MultiExecTest.php index e1f0c5c7..e54edfac 100644 --- a/tests/Predis/Transaction/MultiExecTest.php +++ b/tests/Predis/Transaction/MultiExecTest.php @@ -802,7 +802,8 @@ class MultiExecTest extends PredisTestCase * Returns a mocked instance of Predis\Connection\NodeConnectionInterface * using the specified callback to return values from executeCommand(). * - * @param \Closure $executeCallback + * @param \Closure $executeCallback + * * @return \Predis\Connection\NodeConnectionInterface */ protected function getMockedConnection($executeCallback) @@ -820,9 +821,10 @@ class MultiExecTest extends PredisTestCase * the specified callback to return values from the executeCommand method * of the underlying connection. * - * @param \Closure $executeCallback - * @param array $txOpts - * @param array $clientOpts + * @param \Closure $executeCallback + * @param array $txOpts + * @param array $clientOpts + * * @return MultiExec */ protected function getMockedTransaction($executeCallback, $txOpts = null, $clientOpts = null) @@ -837,9 +839,10 @@ class MultiExecTest extends PredisTestCase /** * Returns a callback that emulates a server-side MULTI/EXEC transaction context. * - * @param array $expected Expected responses. - * @param array $commands Reference to an array storing the whole flow of commands. - * @param array $cas Check and set operations performed by the transaction. + * @param array $expected Expected responses. + * @param array $commands Reference to an array storing the whole flow of commands. + * @param array $cas Check and set operations performed by the transaction. + * * @return \Closure */ protected function getExecuteCallback($expected = array(), &$commands = array(), &$cas = array()) @@ -921,7 +924,8 @@ class MultiExecTest extends PredisTestCase * Converts an array of instances of Predis\Command\CommandInterface and * returns an array containing their IDs. * - * @param array $commands List of commands instances. + * @param array $commands List of commands instances. + * * @return array */ protected static function commandsToIDs($commands) @@ -933,8 +937,9 @@ class MultiExecTest extends PredisTestCase * Returns a client instance connected to the specified Redis * server instance to perform integration tests. * - * @param array $parameters Additional connection parameters. - * @param array $options Additional client options. + * @param array $parameters Additional connection parameters. + * @param array $options Additional client options. + * * @return Client */ protected function getClient(array $parameters = array(), array $options = array())