mirror of
https://github.com/predis/predis.git
synced 2026-09-05 07:16:44 +00:00
[phpdoc] Various phpdoc fixes.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ class MasterSlaveReplication implements ReplicationInterface
|
||||
protected $current;
|
||||
|
||||
/**
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(ReplicationStrategy $strategy = null)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -83,6 +83,8 @@ final class Factory
|
||||
*
|
||||
* @param string $version Profile version or alias.
|
||||
* @return ProfileInterface
|
||||
*
|
||||
* @throws ClientException
|
||||
*/
|
||||
public static function get($version)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -41,6 +41,8 @@ class ReplicationStrategy
|
||||
*
|
||||
* @param CommandInterface $command Command instance.
|
||||
* @return bool
|
||||
*
|
||||
* @throws NotSupportedException
|
||||
*/
|
||||
public function isReadOperation(CommandInterface $command)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -185,7 +185,9 @@ BUFFER;
|
||||
* @group connected
|
||||
* @requiresRedisVersion >= 2.6.9
|
||||
* @dataProvider invalidConnectionNameProvider
|
||||
*
|
||||
* @expectedException Predis\Response\ServerException
|
||||
* @param string $invalidConnectionName
|
||||
*/
|
||||
public function testInvalidSetNameOfConnection($invalidConnectionName)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user