mirror of
https://github.com/predis/predis.git
synced 2026-08-21 10:51:24 +00:00
Apply more phpdoc fixes.
This commit is contained in:
@@ -180,6 +180,7 @@ 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.
|
||||
* @return Client
|
||||
*/
|
||||
public function getClientFor($connectionID)
|
||||
@@ -390,7 +391,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,... 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 */)
|
||||
@@ -428,7 +429,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,... Array of options, a callable for execution, or both.
|
||||
* @param mixed ... Array of options, a callable for execution, or both.
|
||||
* @return TransactionMultiExec|array
|
||||
*/
|
||||
public function transaction(/* arguments */)
|
||||
@@ -458,7 +459,7 @@ 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 $arg,... 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 */)
|
||||
|
||||
@@ -39,6 +39,7 @@ interface DistributorInterface
|
||||
/**
|
||||
* Returns a node from the distributor using the computed hash of a key.
|
||||
*
|
||||
* @param mixed $key
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($key);
|
||||
|
||||
@@ -64,7 +64,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);
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@ interface OptionInterface
|
||||
/**
|
||||
* Filters and validates the passed value.
|
||||
*
|
||||
* @param mixed $value Input value.
|
||||
* @param OptionsInterface $options Options container.
|
||||
* @param mixed $value Input value.
|
||||
* @return mixed
|
||||
*/
|
||||
public function filter(OptionsInterface $options, $value);
|
||||
@@ -30,7 +31,7 @@ interface OptionInterface
|
||||
/**
|
||||
* Returns the default value for the option.
|
||||
*
|
||||
* @param mixed $value Input value.
|
||||
* @param OptionsInterface $options Options container.
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDefault(OptionsInterface $options);
|
||||
|
||||
@@ -21,8 +21,8 @@ interface ParametersInterface
|
||||
/**
|
||||
* 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);
|
||||
|
||||
|
||||
@@ -103,8 +103,8 @@ abstract class RedisProfile implements ProfileInterface
|
||||
/**
|
||||
* Defines a new command in the server profile.
|
||||
*
|
||||
* @param string $commandID Command ID.
|
||||
* @param string $commandClass Fully-qualified name of a Predis\Command\CommandInterface.
|
||||
* @param string $commandID Command ID.
|
||||
* @param string $class Fully-qualified name of a Predis\Command\CommandInterface.
|
||||
*/
|
||||
public function defineCommand($commandID, $class)
|
||||
{
|
||||
|
||||
@@ -56,9 +56,9 @@ abstract class AbstractConsumer 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->writeRequest(self::SUBSCRIBE, func_get_args());
|
||||
$this->statusFlags |= self::STATUS_SUBSCRIBED;
|
||||
@@ -67,9 +67,9 @@ abstract class AbstractConsumer 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->writeRequest(self::UNSUBSCRIBE, func_get_args());
|
||||
}
|
||||
@@ -77,9 +77,9 @@ abstract class AbstractConsumer 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->writeRequest(self::PSUBSCRIBE, func_get_args());
|
||||
$this->statusFlags |= self::STATUS_PSUBSCRIBED;
|
||||
@@ -88,9 +88,9 @@ abstract class AbstractConsumer 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->writeRequest(self::PUNSUBSCRIBE, func_get_args());
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ 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.
|
||||
* @return string
|
||||
*/
|
||||
public static function get($payload)
|
||||
|
||||
@@ -165,7 +165,7 @@ class MultiExec implements BasicClientInterface, ExecutableContextInterface
|
||||
/**
|
||||
* Executes a Redis command bypassing the transaction logic.
|
||||
*
|
||||
* @param string $method Command ID.
|
||||
* @param string $commandID Command ID.
|
||||
* @param array $arguments Arguments for the command.
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
@@ -49,7 +49,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)
|
||||
|
||||
@@ -22,6 +22,7 @@ abstract class PredisProfileTestCase extends PredisTestCase
|
||||
/**
|
||||
* Returns a new instance of the tested profile.
|
||||
*
|
||||
* @param string $version Version of Redis.
|
||||
* @return ProfileInterface
|
||||
*/
|
||||
protected function getProfile($version = null)
|
||||
|
||||
@@ -23,8 +23,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)
|
||||
{
|
||||
@@ -121,7 +122,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 Profile\ProfileInterface
|
||||
*/
|
||||
protected function getProfile($version = null)
|
||||
@@ -132,7 +133,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)
|
||||
@@ -160,8 +163,9 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $expectedVersion Expected redis version
|
||||
* @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)
|
||||
@@ -189,8 +193,9 @@ abstract class PredisTestCase extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $expectedVersion Expected redis version
|
||||
* @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)
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -97,10 +97,10 @@ class CommunicationExceptionTest extends PredisTestCase
|
||||
/**
|
||||
* Returns a connection exception instance.
|
||||
*
|
||||
* @param Connection\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(
|
||||
|
||||
@@ -171,6 +171,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
|
||||
*/
|
||||
|
||||
@@ -487,9 +487,9 @@ class PipelineTest 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())
|
||||
{
|
||||
|
||||
@@ -749,6 +749,8 @@ class MultiExecTest extends PredisTestCase
|
||||
* of the underlying connection.
|
||||
*
|
||||
* @param \Closure $executeCallback
|
||||
* @param array $txOpts
|
||||
* @param array $clientOpts
|
||||
* @return MultiExec
|
||||
*/
|
||||
protected function getMockedTransaction($executeCallback, $txOpts = null, $clientOpts = null)
|
||||
@@ -764,7 +766,8 @@ 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 that stores the whole flow of commands.
|
||||
* @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())
|
||||
|
||||
Reference in New Issue
Block a user