Эх сурвалжийг харах

Merge pull request #123 from drealecs/doctype_fixes

some PHPDoc fixes in lib
Daniele Alessandri 11 жил өмнө
parent
commit
aa458a1922

+ 1 - 3
lib/Predis/Client.php

@@ -15,14 +15,12 @@ use Predis\Command\CommandInterface;
 use Predis\Command\ScriptedCommand;
 use Predis\Connection\AggregatedConnectionInterface;
 use Predis\Connection\ConnectionInterface;
-use Predis\Connection\ConnectionFactory;
 use Predis\Connection\ConnectionFactoryInterface;
 use Predis\Monitor\MonitorContext;
 use Predis\Option\ClientOptions;
 use Predis\Option\ClientOptionsInterface;
 use Predis\Pipeline\PipelineContext;
 use Predis\Profile\ServerProfile;
-use Predis\Profile\ServerProfileInterface;
 use Predis\PubSub\PubSubContext;
 use Predis\Transaction\MultiExecContext;
 
@@ -205,7 +203,7 @@ class Client implements ClientInterface
      * Retrieves a single connection out of an aggregated connections instance.
      *
      * @param string $connectionId Index or alias of the connection.
-     * @return SingleConnectionInterface
+     * @return Connection\SingleConnectionInterface
      */
     public function getConnectionById($connectionId)
     {

+ 1 - 1
lib/Predis/ClientInterface.php

@@ -60,7 +60,7 @@ interface ClientInterface extends BasicClientInterface
      *
      * @param string $method The name of a Redis command.
      * @param array $arguments The arguments for the command.
-     * @return CommandInterface
+     * @return Command\CommandInterface
      */
     public function createCommand($method, $arguments = array());
 }

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

@@ -11,6 +11,8 @@
 
 namespace Predis\Cluster\Distribution;
 
+use Predis\Cluster\Hash\HashGeneratorInterface;
+
 /**
  * A distributor implements the logic to automatically distribute
  * keys among several nodes for client-side sharding.
@@ -44,7 +46,7 @@ interface DistributionStrategyInterface
     /**
      * Returns the underlying hash generator instance.
      *
-     * @return Predis\Cluster\Hash\HashGeneratorInterface
+     * @return HashGeneratorInterface
      */
     public function getHashGenerator();
 }

+ 0 - 2
lib/Predis/Connection/ClusterConnectionInterface.php

@@ -11,8 +11,6 @@
 
 namespace Predis\Connection;
 
-use Predis\Command\CommandInterface;
-
 /**
  * Defines a cluster of Redis servers formed by aggregating multiple
  * connection objects.

+ 3 - 5
lib/Predis/Connection/ConnectionFactoryInterface.php

@@ -11,8 +11,6 @@
 
 namespace Predis\Connection;
 
-use Predis\Profile\ServerProfileInterface;
-
 /**
  * Interface that must be implemented by classes that provide their own mechanism
  * to create and initialize new instances of Predis\Connection\SingleConnectionInterface.
@@ -40,16 +38,16 @@ interface ConnectionFactoryInterface
      * Creates a new connection object.
      *
      * @param mixed $parameters Parameters for the connection.
-     * @return Predis\Connection\SingleConnectionInterface
+     * @return SingleConnectionInterface
      */
     public function create($parameters);
 
     /**
      * Prepares an aggregation of connection objects.
      *
-     * @param AggregatedConnectionInterface Instance of an aggregated connection class.
+     * @param AggregatedConnectionInterface $cluster Instance of an aggregated connection class.
      * @param array $parameters List of parameters for each connection object.
-     * @return Predis\Connection\AggregatedConnectionInterface
+     * @return AggregatedConnectionInterface
      */
     public function createAggregated(AggregatedConnectionInterface $cluster, Array $parameters);
 }

+ 0 - 1
lib/Predis/Connection/ConnectionParameters.php

@@ -12,7 +12,6 @@
 namespace Predis\Connection;
 
 use Predis\ClientException;
-use Predis\Option\OptionInterface;
 
 /**
  * Handles parsing and validation of connection parameters.

+ 0 - 1
lib/Predis/Connection/MasterSlaveReplication.php

@@ -11,7 +11,6 @@
 
 namespace Predis\Connection;
 
-use Predis\NotSupportedException;
 use Predis\Command\CommandInterface;
 use Predis\Replication\ReplicationStrategy;
 

+ 0 - 1
lib/Predis/Connection/PhpiredisConnection.php

@@ -11,7 +11,6 @@
 
 namespace Predis\Connection;
 
-use Predis\ClientException;
 use Predis\NotSupportedException;
 use Predis\ResponseError;
 use Predis\ResponseQueued;

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

@@ -11,7 +11,7 @@
 
 namespace Predis\Connection;
 
-use Predis\ClientException;
+use Predis\Cluster\CommandHashStrategyInterface;
 use Predis\NotSupportedException;
 use Predis\Cluster\PredisClusterHashStrategy;
 use Predis\Cluster\Distribution\DistributionStrategyInterface;
@@ -166,7 +166,7 @@ class PredisCluster implements ClusterConnectionInterface, \IteratorAggregate, \
      * Returns the underlying command hash strategy used to hash
      * commands by their keys.
      *
-     * @return Predis\Cluster\CommandHashStrategyInterface
+     * @return CommandHashStrategyInterface
      */
     public function getCommandHashStrategy()
     {

+ 2 - 1
lib/Predis/Connection/RedisCluster.php

@@ -12,6 +12,7 @@
 namespace Predis\Connection;
 
 use Predis\ClientException;
+use Predis\Cluster\CommandHashStrategyInterface;
 use Predis\NotSupportedException;
 use Predis\ResponseErrorInterface;
 use Predis\Cluster\RedisClusterHashStrategy;
@@ -306,7 +307,7 @@ class RedisCluster implements ClusterConnectionInterface, \IteratorAggregate, \C
      * Returns the underlying command hash strategy used to hash
      * commands by their keys.
      *
-     * @return Predis\Cluster\CommandHashStrategyInterface
+     * @return CommandHashStrategyInterface
      */
     public function getCommandHashStrategy()
     {

+ 0 - 2
lib/Predis/Connection/ReplicationConnectionInterface.php

@@ -11,8 +11,6 @@
 
 namespace Predis\Connection;
 
-use Predis\Command\CommandInterface;
-
 /**
  * Defines a group of Redis servers in a master/slave replication configuration.
  *

+ 0 - 1
lib/Predis/Connection/StreamConnection.php

@@ -11,7 +11,6 @@
 
 namespace Predis\Connection;
 
-use Predis\NotSupportedException;
 use Predis\ResponseError;
 use Predis\ResponseQueued;
 use Predis\Command\CommandInterface;

+ 0 - 4
lib/Predis/Helpers.php

@@ -11,10 +11,6 @@
 
 namespace Predis;
 
-use Predis\Connection\AggregatedConnectionInterface;
-use Predis\Connection\ClusterConnectionInterface;
-use Predis\Connection\ConnectionInterface;
-
 /**
  * Defines a few helper methods.
  *

+ 2 - 2
lib/Predis/Monitor/MonitorContext.php

@@ -27,7 +27,7 @@ class MonitorContext implements \Iterator
     private $position;
 
     /**
-     * @param ClientInterface Client instance used by the context.
+     * @param ClientInterface $client Client instance used by the context.
      */
     public function __construct(ClientInterface $client)
     {
@@ -48,7 +48,7 @@ class MonitorContext implements \Iterator
      * Checks if the passed client instance satisfies the required conditions
      * needed to initialize a monitor context.
      *
-     * @param ClientInterface Client instance used by the context.
+     * @param ClientInterface $client Client instance used by the context.
      */
     private function checkCapabilities(ClientInterface $client)
     {

+ 1 - 1
lib/Predis/Pipeline/FireAndForgetExecutor.php

@@ -28,7 +28,7 @@ class FireAndForgetExecutor implements PipelineExecutorInterface
      * connection before starting to execute the commands stored
      * in the pipeline.
      *
-     * @param ConnectionInterface Connection instance.
+     * @param ConnectionInterface $connection Connection instance.
      */
     protected function checkConnection(ConnectionInterface $connection)
     {

+ 1 - 2
lib/Predis/Pipeline/MultiExecExecutor.php

@@ -16,7 +16,6 @@ use SplQueue;
 use Predis\ClientException;
 use Predis\ResponseErrorInterface;
 use Predis\ResponseObjectInterface;
-use Predis\ResponseQueued;
 use Predis\ServerException;
 use Predis\Connection\ConnectionInterface;
 use Predis\Connection\SingleConnectionInterface;
@@ -47,7 +46,7 @@ class MultiExecExecutor implements PipelineExecutorInterface
      * connection before starting to execute the commands stored
      * in the pipeline.
      *
-     * @param ConnectionInterface Connection instance.
+     * @param ConnectionInterface $connection Connection instance.
      */
     protected function checkConnection(ConnectionInterface $connection)
     {

+ 1 - 1
lib/Predis/Pipeline/PipelineContext.php

@@ -48,7 +48,7 @@ class PipelineContext implements BasicClientInterface, ExecutableContextInterfac
      * Returns a pipeline executor depending on the kind of the underlying
      * connection and the passed options.
      *
-     * @param ClientInterface Client instance used by the context.
+     * @param ClientInterface $client Client instance used by the context.
      * @return PipelineExecutorInterface
      */
     protected function createExecutor(ClientInterface $client)

+ 0 - 1
lib/Predis/Pipeline/SafeExecutor.php

@@ -13,7 +13,6 @@ namespace Predis\Pipeline;
 
 use SplQueue;
 use Predis\CommunicationException;
-use Predis\ServerException;
 use Predis\Connection\ConnectionInterface;
 
 /**

+ 1 - 1
lib/Predis/Pipeline/StandardExecutor.php

@@ -44,7 +44,7 @@ class StandardExecutor implements PipelineExecutorInterface
      * connection before starting to execute the commands stored
      * in the pipeline.
      *
-     * @param ConnectionInterface Connection instance.
+     * @param ConnectionInterface $connection Connection instance.
      */
     protected function checkConnection(ConnectionInterface $connection)
     {

+ 2 - 1
lib/Predis/Profile/ServerProfileInterface.php

@@ -11,6 +11,7 @@
 
 namespace Predis\Profile;
 
+use Predis\Command\CommandInterface;
 
 /**
  * A server profile defines features and commands supported by certain
@@ -49,7 +50,7 @@ interface ServerProfileInterface
      *
      * @param string $method Command ID.
      * @param array $arguments Arguments for the command.
-     * @return Predis\Command\CommandInterface
+     * @return CommandInterface
      */
     public function createCommand($method, $arguments = array());
 }

+ 0 - 1
lib/Predis/Protocol/Text/TextProtocol.php

@@ -14,7 +14,6 @@ namespace Predis\Protocol\Text;
 use Predis\CommunicationException;
 use Predis\ResponseError;
 use Predis\ResponseQueued;
-use Predis\ServerException;
 use Predis\Command\CommandInterface;
 use Predis\Connection\ComposableConnectionInterface;
 use Predis\Iterator\MultiBulkResponseSimple;

+ 0 - 4
lib/Predis/PubSub/AbstractPubSubContext.php

@@ -11,10 +11,6 @@
 
 namespace Predis\PubSub;
 
-use Predis\ClientException;
-use Predis\ClientInterface;
-use Predis\NotSupportedException;
-
 /**
  * Client-side abstraction of a Publish / Subscribe context.
  *

+ 2 - 2
lib/Predis/PubSub/DispatcherLoop.php

@@ -28,7 +28,7 @@ class DispatcherLoop
     protected $subscriptionCallback;
 
     /**
-     * @param ClientInterface Client instance used by the context.
+     * @param ClientInterface $client Client instance used by the context.
      */
     public function __construct(ClientInterface $client)
     {
@@ -39,7 +39,7 @@ class DispatcherLoop
     /**
      * Checks if the passed argument is a valid callback.
      *
-     * @param mixed A callback.
+     * @param mixed $callable A callback.
      */
     protected function validateCallback($callable)
     {

+ 3 - 3
lib/Predis/PubSub/PubSubContext.php

@@ -28,8 +28,8 @@ class PubSubContext extends AbstractPubSubContext
     private $options;
 
     /**
-     * @param ClientInterface Client instance used by the context.
-     * @param array Options for the context initialization.
+     * @param ClientInterface $client Client instance used by the context.
+     * @param array $options Options for the context initialization.
      */
     public function __construct(ClientInterface $client, Array $options = null)
     {
@@ -55,7 +55,7 @@ class PubSubContext extends AbstractPubSubContext
      * Checks if the passed client instance satisfies the required conditions
      * needed to initialize a Publish / Subscribe context.
      *
-     * @param ClientInterface Client instance used by the context.
+     * @param ClientInterface $client Client instance used by the context.
      */
     private function checkCapabilities(ClientInterface $client)
     {

+ 3 - 3
lib/Predis/Transaction/MultiExecContext.php

@@ -47,8 +47,8 @@ class MultiExecContext implements BasicClientInterface, ExecutableContextInterfa
     protected $commands;
 
     /**
-     * @param ClientInterface Client instance used by the context.
-     * @param array Options for the context initialization.
+     * @param ClientInterface $client Client instance used by the context.
+     * @param array $options Options for the context initialization.
      */
     public function __construct(ClientInterface $client, Array $options = null)
     {
@@ -113,7 +113,7 @@ class MultiExecContext implements BasicClientInterface, ExecutableContextInterfa
      * Checks if the passed client instance satisfies the required conditions
      * needed to initialize a transaction context.
      *
-     * @param ClientInterface Client instance used by the context.
+     * @param ClientInterface $client Client instance used by the context.
      */
     private function checkCapabilities(ClientInterface $client)
     {