瀏覽代碼

Apply more phpdoc fixes.

Backported from 6a577a0 (master).
Daniele Alessandri 11 年之前
父節點
當前提交
2aab474670

+ 5 - 5
lib/Predis/Client.php

@@ -319,7 +319,7 @@ 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                 $arg,... Options for the context, a callable object, or both.
+     * @param  mixed                 ... Options for the context, a callable object, or both.
      * @return PipelineContext|array
      */
     public function pipeline(/* arguments */)
@@ -368,7 +368,7 @@ class Client implements ClientInterface
      *             as it will replace Client::multiExec() in the next major
      *             version of the library.
      *
-     * @param  mixed                  $arg,... Options for the context, a callable object, or both.
+     * @param  mixed                  ... Options for the context, a callable object, or both.
      * @return MultiExecContext|array
      */
     public function multiExec(/* arguments */)
@@ -380,7 +380,7 @@ 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                  $arg,... Options for the context, a callable object, or both.
+     * @param  mixed                  ... Options for the context, a callable object, or both.
      * @return MultiExecContext|array
      */
     public function transaction(/* arguments */)
@@ -411,7 +411,7 @@ class Client implements ClientInterface
      *             Client::pubSubLoop() to create Predis\PubSub\PubSubContext
      *             instances from now on.
      *
-     * @param  mixed                   $arg,... Options for the context, a callable object, or both.
+     * @param  mixed                   ... Options for the context, a callable object, or both.
      * @return PubSubExecContext|array
      */
     public function pubSub(/* arguments */)
@@ -423,7 +423,7 @@ class Client implements ClientInterface
      * Creates a new Publish / Subscribe context and returns it, or executes it
      * inside the optionally provided callable object.
      *
-     * @param  mixed                   $arg,... Options for the context, a callable object, or both.
+     * @param  mixed                   ... Options for the context, a callable object, or both.
      * @return PubSubExecContext|array
      */
     public function pubSubLoop(/* arguments */)

+ 1 - 0
lib/Predis/Cluster/Distribution/DistributionStrategyInterface.php

@@ -39,6 +39,7 @@ interface DistributionStrategyInterface
     /**
      * Gets a node from the distributor using the computed hash of a key.
      *
+     * @param  mixed $key
      * @return mixed
      */
     public function get($key);

+ 2 - 1
lib/Predis/Command/CommandInterface.php

@@ -62,7 +62,8 @@ interface CommandInterface
     /**
      * Gets the argument of the command at the specified index.
      *
-     * @return array
+     * @param  int   $index Index of the desired argument.
+     * @return mixed
      */
     public function getArgument($index);
 

+ 2 - 2
lib/Predis/Connection/ConnectionParametersInterface.php

@@ -22,8 +22,8 @@ interface ConnectionParametersInterface
     /**
      * Checks if the specified parameters is set.
      *
-     * @param  string  $property Name of the property.
-     * @return Boolean
+     * @param  string $parameter Name of the parameter.
+     * @return bool
      */
     public function __isset($parameter);
 

+ 7 - 5
lib/Predis/Option/OptionInterface.php

@@ -21,7 +21,8 @@ interface OptionInterface
     /**
      * Filters (and optionally converts) the passed value.
      *
-     * @param  mixed $value Input value.
+     * @param  ClientOptionsInterface $options Options container.
+     * @param  mixed                  $value   Input value.
      * @return mixed
      */
     public function filter(ClientOptionsInterface $options, $value);
@@ -29,16 +30,17 @@ interface OptionInterface
     /**
      * Returns a default value for the option.
      *
-     * @param  mixed $value Input value.
+     * @param  ClientOptionsInterface $options Options container.
      * @return mixed
      */
     public function getDefault(ClientOptionsInterface $options);
 
     /**
-     * Filters a value and, if no value is specified, returns
-     * the default one defined by the option.
+     * Filters a value and, if no value is specified, returns the default one
+     * defined by the option.
      *
-     * @param  mixed $value Input value.
+     * @param  ClientOptionsInterface $options Options container.
+     * @param  mixed                  $value   Input value.
      * @return mixed
      */
     public function __invoke(ClientOptionsInterface $options, $value);

+ 8 - 8
lib/Predis/PubSub/AbstractPubSubContext.php

@@ -54,9 +54,9 @@ abstract class AbstractPubSubContext implements \Iterator
     /**
      * Subscribes to the specified channels.
      *
-     * @param mixed $arg,... One or more channel names.
+     * @param mixed $channel,... One or more channel names.
      */
-    public function subscribe(/* arguments */)
+    public function subscribe($channel /*, ... */)
     {
         $this->writeCommand(self::SUBSCRIBE, func_get_args());
         $this->statusFlags |= self::STATUS_SUBSCRIBED;
@@ -65,9 +65,9 @@ abstract class AbstractPubSubContext implements \Iterator
     /**
      * Unsubscribes from the specified channels.
      *
-     * @param mixed $arg,... One or more channel names.
+     * @param string ... One or more channel names.
      */
-    public function unsubscribe(/* arguments */)
+    public function unsubscribe(/* ... */)
     {
         $this->writeCommand(self::UNSUBSCRIBE, func_get_args());
     }
@@ -75,9 +75,9 @@ abstract class AbstractPubSubContext implements \Iterator
     /**
      * Subscribes to the specified channels using a pattern.
      *
-     * @param mixed $arg,... One or more channel name patterns.
+     * @param mixed $pattern,... One or more channel name patterns.
      */
-    public function psubscribe(/* arguments */)
+    public function psubscribe($pattern /* ... */)
     {
         $this->writeCommand(self::PSUBSCRIBE, func_get_args());
         $this->statusFlags |= self::STATUS_PSUBSCRIBED;
@@ -86,9 +86,9 @@ abstract class AbstractPubSubContext implements \Iterator
     /**
      * Unsubscribes from the specified channels using a pattern.
      *
-     * @param mixed $arg,... One or more channel name patterns.
+     * @param string ... One or more channel name patterns.
      */
-    public function punsubscribe(/* arguments */)
+    public function punsubscribe(/* ... */)
     {
         $this->writeCommand(self::PUNSUBSCRIBE, func_get_args());
     }

+ 1 - 1
tests/PHPUnit/PredisCommandTestCase.php

@@ -48,7 +48,7 @@ abstract class PredisCommandTestCase extends PredisTestCase
     /**
      * Returns a new client instance.
      *
-     * @param  bool   $connect Flush selected database before returning the client.
+     * @param  bool   $flushdb Flush selected database before returning the client.
      * @return Client
      */
     public function getClient($flushdb = true)

+ 1 - 0
tests/PHPUnit/PredisProfileTestCase.php

@@ -21,6 +21,7 @@ abstract class PredisProfileTestCase extends PredisTestCase
     /**
      * Returns a new instance of the tested profile.
      *
+     * @param  string                 $version Version of Redis.
      * @return ServerProfileInterface
      */
     protected function getProfile($version = null)

+ 15 - 10
tests/PHPUnit/PredisTestCase.php

@@ -24,8 +24,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|CommandInterface $command   Expected command or command ID.
-     * @param array                   $arguments Expected command arguments.
+     * @param  string|CommandInterface $command   Expected command or command ID.
+     * @param  array                   $arguments Expected command arguments.
+     * @return RedisCommandConstraint
      */
     public function isRedisCommand($command = null, array $arguments = null)
     {
@@ -122,7 +123,7 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase
     /**
      * Returns a new instance of server profile.
      *
-     * @param  array                  $additional Additional connection parameters.
+     * @param  string                 $version Redis profile.
      * @return ServerProfileInterface
      */
     protected function getProfile($version = null)
@@ -133,7 +134,9 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase
     /**
      * Returns a new client instance.
      *
-     * @param  bool   $connect 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)
@@ -161,9 +164,10 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase
     }
 
     /**
-     * @param  string                              $expectedVersion Expected redis version
-     * @param  string                              $operator        Comparison operator.
-     * @throws \PHPUnit_Framework_SkippedTestError when expected redis version is not met
+     * @param  string                             $expectedVersion Expected redis version.
+     * @param  string                             $operator        Comparison operator.
+     * @param  callable                           $callback        Callback for matching version.
+     * @throws PHPUnit_Framework_SkippedTestError When expected redis version is not met.
      */
     protected function executeOnRedisVersion($expectedVersion, $operator, $callback)
     {
@@ -190,9 +194,10 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase
     }
 
     /**
-     * @param  string                              $expectedVersion Expected redis version
-     * @param  string                              $operator        Comparison operator.
-     * @throws \PHPUnit_Framework_SkippedTestError when expected redis version is not met
+     * @param  string                             $expectedVersion Expected redis version.
+     * @param  string                             $operator        Comparison operator.
+     * @param  callable                           $callback        Callback for matching version.
+     * @throws PHPUnit_Framework_SkippedTestError When expected redis version is not met.
      */
     protected function executeOnProfileVersion($expectedVersion, $operator, $callback)
     {

+ 2 - 1
tests/PHPUnit/RedisCommandConstraint.php

@@ -20,7 +20,8 @@ class RedisCommandConstraint extends PHPUnit_Framework_Constraint
     protected $arguments;
 
     /**
-     * @param array $array
+     * @param string|CommandInterface $command   Expected command ID or instance.
+     * @param array                   $arguments Expected command arguments.
      */
     public function __construct($command = null, array $arguments = null)
     {

+ 4 - 4
tests/Predis/CommunicationExceptionTest.php

@@ -97,10 +97,10 @@ class CommunicationExceptionTest extends PredisTestCase
     /**
      * Returns a connection exception instance.
      *
-     * @param  SingleConnectionInterface $message Connection instance.
-     * @param  string                    $message Exception message.
-     * @param  int                       $code    Exception code.
-     * @param  \Exception                $inner   Inner exception.
+     * @param  Connection\SingleConnectionInterface $connection Connection instance.
+     * @param  string                               $message    Exception message.
+     * @param  int                                  $code       Exception code.
+     * @param  \Exception                           $inner      Inner exception.
      * @return \Exception
      */
     protected function getException(SingleConnectionInterface $connection, $message, $code = 0, \Exception $inner = null)

+ 1 - 0
tests/Predis/Connection/WebdisConnectionTest.php

@@ -169,6 +169,7 @@ class WebdisConnectionTest extends PredisTestCase
     /**
      * Returns a new instance of a connection instance.
      *
+     * @param  mixed            $profile    Redis profile.
      * @param  array            $parameters Additional connection parameters.
      * @return WebdisConnection
      */

+ 3 - 3
tests/Predis/Pipeline/PipelineContextTest.php

@@ -408,9 +408,9 @@ class PipelineContextTest extends PredisTestCase
      * Returns a client instance connected to the specified Redis
      * server instance to perform integration tests.
      *
-     * @return array  Additional connection parameters.
-     * @return array  Additional client options.
-     * @return Client New client instance.
+     * @param  array  $parameters Additional connection parameters.
+     * @param  array  $options    Additional client options.
+     * @return Client
      */
     protected function getClient(array $parameters = array(), array $options = array())
     {

+ 4 - 2
tests/Predis/Transaction/MultiExecContextTest.php

@@ -657,6 +657,7 @@ class MultiExecContextTest extends PredisTestCase
      * of the underlying connection.
      *
      * @param  \Closure         $executeCallback
+     * @param  array            $options
      * @return MultiExecContext
      */
     protected function getMockedTransaction($executeCallback, $options = array())
@@ -671,8 +672,9 @@ class MultiExecContextTest extends PredisTestCase
     /**
      * Returns a callback that emulates a server-side MULTI/EXEC transaction context.
      *
-     * @param  array    $expected Expected replies.
-     * @param  array    $commands Reference to an array that stores the whole flow of commands.
+     * @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())