diff --git a/src/Client.php b/src/Client.php index ea503f1f..ea99ade6 100644 --- a/src/Client.php +++ b/src/Client.php @@ -245,6 +245,8 @@ class Client implements ClientInterface * * @param string $connectionID Index or alias of the single connection. * @return Connection\NodeConnectionInterface + * + * @throws NotSupportedException */ public function getConnectionById($connectionID) { @@ -330,6 +332,8 @@ class Client implements ClientInterface * @param CommandInterface $command Redis command that generated the error. * @param ErrorResponseInterface $response Instance of the error response. * @return mixed + * + * @throws ServerException */ protected function onErrorResponse(CommandInterface $command, ErrorResponseInterface $response) { diff --git a/src/ClientContextInterface.php b/src/ClientContextInterface.php index 97651bb8..0203211e 100644 --- a/src/ClientContextInterface.php +++ b/src/ClientContextInterface.php @@ -170,7 +170,7 @@ interface ClientContextInterface /** * Sends the specified command with its arguments to Redis. * - * @param string $commandID Command ID. + * @param string $method Command ID. * @param array $arguments Arguments for the command. * @return mixed */ diff --git a/src/ClientInterface.php b/src/ClientInterface.php index a9d2ac89..0b628afa 100644 --- a/src/ClientInterface.php +++ b/src/ClientInterface.php @@ -218,7 +218,7 @@ interface ClientInterface * Creates a Redis command with the specified arguments and sends a request * to the server. * - * @param string $commandID Command ID. + * @param string $method Command ID. * @param array $arguments Arguments for the command. * @return mixed */ diff --git a/src/Cluster/Distributor/DistributorInterface.php b/src/Cluster/Distributor/DistributorInterface.php index e52d8ce8..4322be8c 100644 --- a/src/Cluster/Distributor/DistributorInterface.php +++ b/src/Cluster/Distributor/DistributorInterface.php @@ -40,7 +40,7 @@ interface DistributorInterface * Returns the corresponding slot of a node from the distributor using the * computed hash of a key. * - * @param mixed $key + * @param mixed $hash * @return mixed */ public function getSlot($hash); @@ -48,7 +48,7 @@ interface DistributorInterface /** * Returns a node from the distributor using its assigned slot ID. * - * @param mixed $key + * @param mixed $slot * @return mixed */ public function getBySlot($slot); diff --git a/src/Collection/Iterator/CursorBasedIterator.php b/src/Collection/Iterator/CursorBasedIterator.php index 32632443..54160b1e 100644 --- a/src/Collection/Iterator/CursorBasedIterator.php +++ b/src/Collection/Iterator/CursorBasedIterator.php @@ -61,6 +61,8 @@ abstract class CursorBasedIterator implements Iterator * * @param ClientInterface $client Client connected to Redis. * @param string $commandID Command ID. + * + * @throws NotSupportedException */ protected function requiredCommand(ClientInterface $client, $commandID) { diff --git a/src/Collection/Iterator/ListKey.php b/src/Collection/Iterator/ListKey.php index ff36bcac..da5f6042 100644 --- a/src/Collection/Iterator/ListKey.php +++ b/src/Collection/Iterator/ListKey.php @@ -67,6 +67,8 @@ class ListKey implements Iterator * * @param ClientInterface $client Client connected to Redis. * @param string $commandID Command ID. + * + * @throws NotSupportedException */ protected function requiredCommand(ClientInterface $client, $commandID) { diff --git a/src/CommunicationException.php b/src/CommunicationException.php index c3789a51..9f18ca23 100644 --- a/src/CommunicationException.php +++ b/src/CommunicationException.php @@ -63,6 +63,8 @@ abstract class CommunicationException extends PredisException * Helper method to handle exceptions generated by a connection object. * * @param CommunicationException $exception Exception. + * + * @throws CommunicationException */ public static function handle(CommunicationException $exception) { diff --git a/src/Connection/Aggregate/MasterSlaveReplication.php b/src/Connection/Aggregate/MasterSlaveReplication.php index fa7bcda5..200aac43 100644 --- a/src/Connection/Aggregate/MasterSlaveReplication.php +++ b/src/Connection/Aggregate/MasterSlaveReplication.php @@ -31,7 +31,7 @@ class MasterSlaveReplication implements ReplicationInterface protected $current; /** - * + * {@inheritdoc} */ public function __construct(ReplicationStrategy $strategy = null) { diff --git a/src/Connection/WebdisConnection.php b/src/Connection/WebdisConnection.php index b3c92fb7..b546852b 100644 --- a/src/Connection/WebdisConnection.php +++ b/src/Connection/WebdisConnection.php @@ -77,11 +77,15 @@ class WebdisConnection implements NodeConnectionInterface /** * Helper method used to throw on unsupported methods. + * + * @param string $method Name of the unsupported method. + * + * @throws NotSupportedException */ - private function throwNotSupportedException($function) + private function throwNotSupportedException($method) { $class = __CLASS__; - throw new NotSupportedException("The method $class::$function() is not supported."); + throw new NotSupportedException("The method $class::$method() is not supported."); } /** @@ -211,6 +215,8 @@ class WebdisConnection implements NodeConnectionInterface * * @param CommandInterface $command Command instance. * @return string + * + * @throws NotSupportedException */ protected function getCommandId(CommandInterface $command) { diff --git a/src/Monitor/Consumer.php b/src/Monitor/Consumer.php index a9a4d9f9..60bebd7f 100644 --- a/src/Monitor/Consumer.php +++ b/src/Monitor/Consumer.php @@ -51,6 +51,8 @@ class Consumer implements Iterator * needed to initialize a monitor consumer. * * @param ClientInterface $client Client instance used by the consumer. + * + * @throws NotSupportedException */ private function assertClient(ClientInterface $client) { diff --git a/src/Pipeline/Pipeline.php b/src/Pipeline/Pipeline.php index 25126b7a..ecdba8e0 100644 --- a/src/Pipeline/Pipeline.php +++ b/src/Pipeline/Pipeline.php @@ -92,6 +92,8 @@ class Pipeline implements ClientContextInterface * * @param ConnectionInterface $connection Redis connection that returned the error. * @param ErrorResponseInterface $response Instance of the error response. + * + * @throws ServerException */ protected function exception(ConnectionInterface $connection, ErrorResponseInterface $response) { @@ -172,6 +174,8 @@ class Pipeline implements ClientContextInterface * Marks the running status of the pipeline. * * @param bool $bool Sets the running status of the pipeline. + * + * @throws ClientException */ private function setRunning($bool) { @@ -186,7 +190,11 @@ class Pipeline implements ClientContextInterface * Handles the actual execution of the whole pipeline. * * @param mixed $callable Optional callback for execution. + * @throws null * @return array + * + * @throws Exception + * @throws InvalidArgumentException */ public function execute($callable = null) { diff --git a/src/Profile/Factory.php b/src/Profile/Factory.php index 49a88d01..9b543975 100644 --- a/src/Profile/Factory.php +++ b/src/Profile/Factory.php @@ -83,6 +83,8 @@ final class Factory * * @param string $version Profile version or alias. * @return ProfileInterface + * + * @throws ClientException */ public static function get($version) { diff --git a/src/PubSub/Consumer.php b/src/PubSub/Consumer.php index 25fb0b42..56347ed9 100644 --- a/src/PubSub/Consumer.php +++ b/src/PubSub/Consumer.php @@ -56,6 +56,8 @@ class Consumer extends AbstractConsumer * initialize a PUB/SUB consumer. * * @param ClientInterface $client Client instance used by the consumer. + * + * @throws NotSupportedException */ private function checkCapabilities(ClientInterface $client) { diff --git a/src/Replication/ReplicationStrategy.php b/src/Replication/ReplicationStrategy.php index ef56d440..952ab615 100644 --- a/src/Replication/ReplicationStrategy.php +++ b/src/Replication/ReplicationStrategy.php @@ -41,6 +41,8 @@ class ReplicationStrategy * * @param CommandInterface $command Command instance. * @return bool + * + * @throws NotSupportedException */ public function isReadOperation(CommandInterface $command) { diff --git a/src/Transaction/MultiExec.php b/src/Transaction/MultiExec.php index c8b41d37..35735ba6 100644 --- a/src/Transaction/MultiExec.php +++ b/src/Transaction/MultiExec.php @@ -64,6 +64,8 @@ class MultiExec implements ClientContextInterface * needed to initialize the transaction object. * * @param ClientInterface $client Client instance used by the transaction object. + * + * @throws NotSupportedException */ private function preconditions(ClientInterface $client) { @@ -169,6 +171,8 @@ class MultiExec implements ClientContextInterface * @param string $commandID Command ID. * @param array $arguments Arguments for the command. * @return mixed + * + * @throws ServerException */ protected function call($commandID, $arguments = array()) { @@ -187,6 +191,9 @@ class MultiExec implements ClientContextInterface * * @param CommandInterface $command Command instance. * @return $this|mixed + * + * @throws AbortedMultiExecException + * @throws CommunicationException */ public function executeCommand(CommandInterface $command) { @@ -214,6 +221,9 @@ class MultiExec implements ClientContextInterface * * @param string|array $keys One or more keys. * @return mixed + * + * @throws NotSupportedException + * @throws ClientException */ public function watch($keys) { @@ -253,6 +263,8 @@ class MultiExec implements ClientContextInterface * Executes UNWATCH. * * @return MultiExec + * + * @throws NotSupportedException */ public function unwatch() { @@ -298,6 +310,9 @@ class MultiExec implements ClientContextInterface * Checks the state of the transaction before execution. * * @param mixed $callable Callback for execution. + * + * @throws InvalidArgumentException + * @throws ClientException */ private function checkBeforeExecution($callable) { @@ -333,6 +348,10 @@ class MultiExec implements ClientContextInterface * * @param mixed $callable Optional callback for execution. * @return array + * + * @throws CommunicationException + * @throws AbortedMultiExecException + * @throws ServerException */ public function execute($callable = null) { @@ -396,6 +415,9 @@ class MultiExec implements ClientContextInterface * Passes the current transaction object to a callable block for execution. * * @param mixed $callable Callback. + * + * @throws CommunicationException + * @throws ServerException */ protected function executeTransactionBlock($callable) { diff --git a/tests/PHPUnit/PredisTestCase.php b/tests/PHPUnit/PredisTestCase.php index 33d3c8a5..f3f1c253 100644 --- a/tests/PHPUnit/PredisTestCase.php +++ b/tests/PHPUnit/PredisTestCase.php @@ -198,6 +198,7 @@ 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. + * @return string * @throws PHPUnit_Framework_SkippedTestError When expected redis version is not met */ protected function executeOnRedisVersion($expectedVersion, $operator, $callback) @@ -216,6 +217,7 @@ 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. + * @return string * @throws PHPUnit_Framework_SkippedTestError When expected redis version is not met */ protected function executeOnProfileVersion($expectedVersion, $operator, $callback) diff --git a/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php b/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php index 3d108b7b..437ca137 100644 --- a/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php +++ b/tests/Predis/Command/Processor/KeyPrefixProcessorTest.php @@ -245,6 +245,10 @@ class KeyPrefixProcessorTest extends PredisTestCase /** * @group disconnected * @dataProvider commandArgumentsDataProvider + * + * @param string $commandID + * @param array $arguments + * @param array $expected */ public function testApplyPrefixToCommand($commandID, array $arguments, array $expected) { diff --git a/tests/Predis/Command/ServerClientTest.php b/tests/Predis/Command/ServerClientTest.php index a6459b79..8015c4d4 100644 --- a/tests/Predis/Command/ServerClientTest.php +++ b/tests/Predis/Command/ServerClientTest.php @@ -185,7 +185,9 @@ BUFFER; * @group connected * @requiresRedisVersion >= 2.6.9 * @dataProvider invalidConnectionNameProvider + * * @expectedException Predis\Response\ServerException + * @param string $invalidConnectionName */ public function testInvalidSetNameOfConnection($invalidConnectionName) {