From 29f26b0f9bdb293d43708f2f42abbab3eb2003ad Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Sat, 22 Oct 2011 11:41:58 +0200 Subject: [PATCH] [phpdoc] Apply a few fixes to the documentation. --- lib/Predis/Client.php | 34 +++++++++--------- lib/Predis/Commands/Command.php | 2 +- lib/Predis/Commands/ICommand.php | 4 +-- .../Processors/ICommandProcessorChain.php | 2 +- .../Processors/KeyPrefixProcessor.php | 2 +- lib/Predis/Commands/ZSetRange.php | 2 +- lib/Predis/Commands/ZSetUnionStore.php | 2 +- .../Iterators/MultiBulkResponseTuple.php | 2 +- lib/Predis/MonitorContext.php | 2 +- lib/Predis/Network/ConnectionBase.php | 2 +- lib/Predis/Network/PhpiredisConnection.php | 35 +++++++++---------- lib/Predis/Network/StreamConnection.php | 6 ++-- lib/Predis/Network/WebdisConnection.php | 25 +++++++------ lib/Predis/PubSubContext.php | 2 +- 14 files changed, 60 insertions(+), 62 deletions(-) diff --git a/lib/Predis/Client.php b/lib/Predis/Client.php index 114703dc..d0bb85c7 100644 --- a/lib/Predis/Client.php +++ b/lib/Predis/Client.php @@ -36,7 +36,7 @@ class Client /** * Initializes a new client with optional connection parameters and client options. * - * @param mixed $parameters Connection parameters for one or multiple Redis servers. + * @param mixed $parameters Connection parameters for one or multiple servers. * @param mixed $options Options that specify certain behaviours for the client. */ public function __construct($parameters = null, $options = null) @@ -56,8 +56,8 @@ class Client /** * Creates an instance of Predis\Options\ClientOptions from various types of - * parameters (string, array, Predis\Profiles\ServerProfile) or returns the - * passed object if its an instance of Predis\Options\ClientOptions. + * arguments (string, array, Predis\Profiles\ServerProfile) or returns the + * passed object if it is an instance of Predis\Options\ClientOptions. * * @param mixed $options Client options. * @return ClientOptions @@ -84,11 +84,11 @@ class Client } /** - * Initialize one or multiple connection (cluster) objects from various types of - * parameters (string, array) or returns the passed object if it implements the - * Predis\Network\IConnection interface. + * Initializes one or multiple connection (cluster) objects from various + * types of arguments (string, array) or returns the passed object if it + * implements the Predis\Network\IConnection interface. * - * @param mixed $parameters Connection parameters or object. + * @param mixed $parameters Connection parameters or instance. * @return IConnection */ private function initializeConnection($parameters) @@ -117,7 +117,7 @@ class Client } /** - * Create a new connection to a single Redis server using the provided parameters. + * Creates a new connection to a single server with the provided parameters. * * @param mixed $parameters Connection parameters. * @return IConnectionSingle @@ -151,7 +151,7 @@ class Client } /** - * Returns the client options specified upon client initialization. + * Returns the client options specified upon initialization. * * @return ClientOptions */ @@ -171,9 +171,9 @@ class Client } /** - * Returns a new client instance for the specified connection when the client - * is connected to a cluster. The new client will use the same options of the - * the original instance. + * Returns a new instance of a client for the specified connection when the + * client is connected to a cluster. The new instance will use the same + * options of the original client. * * @return Client */ @@ -187,7 +187,7 @@ class Client } /** - * Opens the connection to Redis. + * Opens the connection to the server. */ public function connect() { @@ -195,7 +195,7 @@ class Client } /** - * Disconnects from Redis. + * Disconnects from the server. */ public function disconnect() { @@ -203,7 +203,9 @@ class Client } /** - * Disconnects from Redis. This method is an alias of disconnect(). + * Disconnects from the server. + * + * This method is an alias of disconnect(). */ public function quit() { @@ -301,7 +303,7 @@ class Client } /** - * Call the specified initializer method on $this with 0, 1 or 2 arguments. + * Calls the specified initializer method on $this with 0, 1 or 2 arguments. * * TODO: Invert $argv and $initializer. * diff --git a/lib/Predis/Commands/Command.php b/lib/Predis/Commands/Command.php index 7a4872b3..7679ac18 100644 --- a/lib/Predis/Commands/Command.php +++ b/lib/Predis/Commands/Command.php @@ -64,7 +64,7 @@ abstract class Command implements ICommand } /** - * Get the argument from the arguments list at the specified index. + * Gets the argument from the arguments list at the specified index. * * @param array $arguments Position of the argument. */ diff --git a/lib/Predis/Commands/ICommand.php b/lib/Predis/Commands/ICommand.php index ec147496..4de64605 100644 --- a/lib/Predis/Commands/ICommand.php +++ b/lib/Predis/Commands/ICommand.php @@ -36,14 +36,14 @@ interface ICommand public function getHash(INodeKeyGenerator $distributor); /** - * Set the arguments of the command. + * Sets the arguments of the command. * * @param array $arguments List of arguments. */ public function setArguments(Array $arguments); /** - * Get the arguments of the command. + * Gets the arguments of the command. * * @return array */ diff --git a/lib/Predis/Commands/Processors/ICommandProcessorChain.php b/lib/Predis/Commands/Processors/ICommandProcessorChain.php index 233e2b67..d82bd879 100644 --- a/lib/Predis/Commands/Processors/ICommandProcessorChain.php +++ b/lib/Predis/Commands/Processors/ICommandProcessorChain.php @@ -34,7 +34,7 @@ interface ICommandProcessorChain extends ICommandProcessor, \IteratorAggregate, public function remove(ICommandProcessor $processor); /** - * Gets the ordered list of command processors in the chain. + * Returns an ordered list of the command processors in the chain. * * @return array */ diff --git a/lib/Predis/Commands/Processors/KeyPrefixProcessor.php b/lib/Predis/Commands/Processors/KeyPrefixProcessor.php index d964d5ec..bb1baebb 100644 --- a/lib/Predis/Commands/Processors/KeyPrefixProcessor.php +++ b/lib/Predis/Commands/Processors/KeyPrefixProcessor.php @@ -42,7 +42,7 @@ class KeyPrefixProcessor implements ICommandProcessor } /** - * Get the current prefix. + * Gets the current prefix. * * @return string */ diff --git a/lib/Predis/Commands/ZSetRange.php b/lib/Predis/Commands/ZSetRange.php index c45f2d50..6653e76a 100644 --- a/lib/Predis/Commands/ZSetRange.php +++ b/lib/Predis/Commands/ZSetRange.php @@ -51,7 +51,7 @@ class ZSetRange extends Command } /** - * Return a list of options and modifiers compatible with Redis. + * Returns a list of options and modifiers compatible with Redis. * * @param array $options List of options. * @return array diff --git a/lib/Predis/Commands/ZSetUnionStore.php b/lib/Predis/Commands/ZSetUnionStore.php index 84d9c3a5..00aa4cc0 100644 --- a/lib/Predis/Commands/ZSetUnionStore.php +++ b/lib/Predis/Commands/ZSetUnionStore.php @@ -48,7 +48,7 @@ class ZSetUnionStore extends Command } /** - * Return a list of options and modifiers compatible with Redis. + * Returns a list of options and modifiers compatible with Redis. * * @param array $options List of options. * @return array diff --git a/lib/Predis/Iterators/MultiBulkResponseTuple.php b/lib/Predis/Iterators/MultiBulkResponseTuple.php index 59522b8e..472c02b4 100644 --- a/lib/Predis/Iterators/MultiBulkResponseTuple.php +++ b/lib/Predis/Iterators/MultiBulkResponseTuple.php @@ -12,7 +12,7 @@ namespace Predis\Iterators; /** - * Abstract the access to a streamable list of tuples represented + * Abstracts the access to a streamable list of tuples represented * as a multibulk reply that alternates keys and values. * * @author Daniele Alessandri diff --git a/lib/Predis/MonitorContext.php b/lib/Predis/MonitorContext.php index abebc001..65b1cb23 100644 --- a/lib/Predis/MonitorContext.php +++ b/lib/Predis/MonitorContext.php @@ -12,7 +12,7 @@ namespace Predis; /** - * Client-side abstraction of a Redis monitor context. + * Client-side abstraction of a Redis MONITOR context. * * @author Daniele Alessandri */ diff --git a/lib/Predis/Network/ConnectionBase.php b/lib/Predis/Network/ConnectionBase.php index a3466751..310a4523 100644 --- a/lib/Predis/Network/ConnectionBase.php +++ b/lib/Predis/Network/ConnectionBase.php @@ -43,7 +43,7 @@ abstract class ConnectionBase implements IConnectionSingle } /** - * Disconnect from the server and destroys the underlying resource when + * Disconnects from the server and destroys the underlying resource when * PHP's garbage collector kicks in. */ public function __destruct() diff --git a/lib/Predis/Network/PhpiredisConnection.php b/lib/Predis/Network/PhpiredisConnection.php index 4b0fc761..524c5bbb 100644 --- a/lib/Predis/Network/PhpiredisConnection.php +++ b/lib/Predis/Network/PhpiredisConnection.php @@ -11,21 +11,6 @@ namespace Predis\Network; -// This class provides the implementation of a Predis connection that internally -// uses the PHP socket extension for network communication and wraps the phpiredis -// C extension (PHP bindings for hiredis) to parse the Redis protocol. Everything -// is *highly experimental* (even the very same phpiredis since it is quite new), -// so use it at your own risk. - -// This class is mainly intended to provide an optional low-overhead alternative -// for processing replies from Redis compared to the standard pure-PHP classes. -// Differences in speed when dealing with short inline replies are practically -// nonexistent, the actual speed boost is for long multibulk replies when this -// protocol processor can parse and return replies very fast. - -// For instructions on how to build and install the phpiredis extension, please -// consult the repository of the project at http://github.com/seppo0010/phpiredis - use Predis\ResponseError; use Predis\ResponseQueued; use Predis\ClientException; @@ -34,10 +19,22 @@ use Predis\IConnectionParameters; use Predis\Commands\ICommand; /** - * Connection abstraction to Redis servers based on PHP's sockets to - * handle the actual network connection and the phpiredis extension to - * handle the parsing of Redis protocol. + * This class provides the implementation of a Predis connection that uses the + * PHP socket extension for network communication and wraps the phpiredis C + * extension (PHP bindings for hiredis) to parse the Redis protocol. Everything + * is highly experimental (even the very same phpiredis since it is quite new), + * so use it at your own risk. * + * This class is mainly intended to provide an optional low-overhead alternative + * for processing replies from Redis compared to the standard pure-PHP classes. + * Differences in speed when dealing with short inline replies are practically + * nonexistent, the actual speed boost is for long multibulk replies when this + * protocol processor can parse and return replies very fast. + * + * For instructions on how to build and install the phpiredis extension, please + * consult the repository of the project. + * + * @link http://github.com/seppo0010/phpiredis * @author Daniele Alessandri */ class PhpiredisConnection extends ConnectionBase @@ -60,7 +57,7 @@ class PhpiredisConnection extends ConnectionBase } /** - * Disconnect from the server and destroys the underlying resource and the + * Disconnects from the server and destroys the underlying resource and the * protocol reader resource when PHP's garbage collector kicks in. */ public function __destruct() diff --git a/lib/Predis/Network/StreamConnection.php b/lib/Predis/Network/StreamConnection.php index 09899b7c..c3ca56fb 100644 --- a/lib/Predis/Network/StreamConnection.php +++ b/lib/Predis/Network/StreamConnection.php @@ -29,7 +29,7 @@ class StreamConnection extends ConnectionBase private $_throwErrors; /** - * Disconnect from the server and destroys the underlying resource when + * Disconnects from the server and destroys the underlying resource when * PHP's garbage collector kicks in only if the connection has not been * marked as persistent. */ @@ -161,8 +161,8 @@ class StreamConnection extends ConnectionBase } /** - * Perform a write operation on the stream of the buffer containing a command - * serialized with the Redis wire protocol. + * Performs a write operation on the stream of the buffer containing a + * command serialized with the Redis wire protocol. * * @param string $buffer Redis wire protocol representation of a command. */ diff --git a/lib/Predis/Network/WebdisConnection.php b/lib/Predis/Network/WebdisConnection.php index 52586334..35ef92d4 100644 --- a/lib/Predis/Network/WebdisConnection.php +++ b/lib/Predis/Network/WebdisConnection.php @@ -11,17 +11,6 @@ namespace Predis\Network; -// This class implements a Predis connection that actually talks with Webdis -// (http://github.com/nicolasff/webdis) instead of connecting directly to Redis. -// It relies on the cURL extension to communicate with the web server and the -// phpiredis extension to parse the protocol of the replies returned in the http -// response bodies. -// -// Some features are not yet available or they simply cannot be implemented: -// - Pipelining commands. -// - Publish / Subscribe. -// - MULTI / EXEC transactions (not yet supported by Webdis). - use Predis\IConnectionParameters; use Predis\ResponseError; use Predis\ClientException; @@ -32,9 +21,19 @@ use Predis\Protocol\ProtocolException; const ERR_MSG_EXTENSION = 'The %s extension must be loaded in order to be able to use this connection class'; /** - * Connection abstraction to Webdis servers. + * This class implements a Predis connection that actually talks with Webdis + * instead of connecting directly to Redis. It relies on the cURL extension to + * communicate with the web server and the phpiredis extension to parse the + * protocol of the replies returned in the http response bodies. * - * @link http://webd.is/ + * Some features are not yet available or they simply cannot be implemented: + * - Pipelining commands. + * - Publish / Subscribe. + * - MULTI / EXEC transactions (not yet supported by Webdis). + * + * @link http://webd.is + * @link http://github.com/nicolasff/webdis + * @link http://github.com/seppo0010/phpiredis * @author Daniele Alessandri */ class WebdisConnection implements IConnectionSingle diff --git a/lib/Predis/PubSubContext.php b/lib/Predis/PubSubContext.php index a5832b29..9c0bb188 100644 --- a/lib/Predis/PubSubContext.php +++ b/lib/Predis/PubSubContext.php @@ -160,7 +160,7 @@ class PubSubContext implements \Iterator } /** - * Write a Redis command on the underlying connection. + * Writes a Redis command on the underlying connection. * * @param string $method ID of the command. * @param array $arguments List of arguments.