Explorar o código

[phpdoc] Various phpdoc fixes.

Daniele Alessandri %!s(int64=10) %!d(string=hai) anos
pai
achega
30254a2594

+ 4 - 0
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)
     {

+ 1 - 1
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
      */

+ 1 - 1
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
      */

+ 2 - 2
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);

+ 2 - 0
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)
     {

+ 2 - 0
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)
     {

+ 2 - 0
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)
     {

+ 1 - 1
src/Connection/Aggregate/MasterSlaveReplication.php

@@ -31,7 +31,7 @@ class MasterSlaveReplication implements ReplicationInterface
     protected $current;
 
     /**
-     *
+     * {@inheritdoc}
      */
     public function __construct(ReplicationStrategy $strategy = null)
     {

+ 8 - 2
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)
     {

+ 2 - 0
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)
     {

+ 8 - 0
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)
     {

+ 2 - 0
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)
     {

+ 2 - 0
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)
     {

+ 2 - 0
src/Replication/ReplicationStrategy.php

@@ -41,6 +41,8 @@ class ReplicationStrategy
      *
      * @param  CommandInterface $command Command instance.
      * @return bool
+     *
+     * @throws NotSupportedException
      */
     public function isReadOperation(CommandInterface $command)
     {

+ 22 - 0
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)
     {

+ 2 - 0
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)

+ 4 - 0
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)
     {

+ 2 - 0
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)
     {