From 7d78600506187c17810abc9f662b1f037f76193a Mon Sep 17 00:00:00 2001 From: Daniele Alessandri Date: Wed, 23 Jul 2014 16:01:11 +0200 Subject: [PATCH] Add phpdocs for Redis commands in Predis\ClientInterface. This commit addresses a long-standing feature request posted in #89. --- src/Client.php | 2 + src/ClientInterface.php | 146 ++++++++++++++++++++++++- src/Configuration/Options.php | 2 + src/Configuration/OptionsInterface.php | 2 +- src/Connection/Parameters.php | 4 +- src/Connection/ParametersInterface.php | 2 +- 6 files changed, 153 insertions(+), 5 deletions(-) diff --git a/src/Client.php b/src/Client.php index 6f2484c2..ebe97832 100644 --- a/src/Client.php +++ b/src/Client.php @@ -36,6 +36,8 @@ use Predis\Transaction\MultiExec as MultiExecTransaction; * abstractions are built. Internally it aggregates various other classes each * one with its own responsibility and scope. * + * {@inheritdoc} + * * @author Daniele Alessandri */ class Client implements ClientInterface diff --git a/src/ClientInterface.php b/src/ClientInterface.php index b5ad3056..a9d2ac89 100644 --- a/src/ClientInterface.php +++ b/src/ClientInterface.php @@ -17,8 +17,150 @@ use Predis\Connection\ConnectionInterface; use Predis\Profile\ProfileInterface; /** - * Interface defining an high-level Redis client that can interact with other - * building blocks of Predis. + * Interface defining a client able to execute commands against Redis. + * + * All the commands exposed by the client generally have the same signature as + * described by the Redis documentation, but some of them offer an additional + * and more friendly interface to ease programming which is described in the + * following list of methods: + * + * @method int del(array $keys) + * @method string dump($key) + * @method int exists($key) + * @method int expire($key, $seconds) + * @method int expireat($key, $timestamp) + * @method array keys($pattern) + * @method int move($key, $db) + * @method mixed object($subcommand, $key) + * @method int persist($key) + * @method int pexpire($key, $milliseconds) + * @method int pexpireat($key, $timestamp) + * @method int pttl($key) + * @method string randomkey() + * @method mixed rename($key, $target) + * @method int renamenx($key, $target) + * @method array scan($cursor, array $options = null) + * @method array sort($key, array $options = null) + * @method int ttl($key) + * @method mixed type($key) + * @method int append($key, $value) + * @method int bitcount($key, $start = null, $end = null) + * @method int bitop($operation, $destkey, $key) + * @method int decr($key) + * @method int decrby($key, $decrement) + * @method string get($key) + * @method int getbit($key, $offset) + * @method string getrange($key, $start, $end) + * @method string getset($key, $value) + * @method int incr($key) + * @method int incrby($key, $increment) + * @method string incrbyfloat($key, $increment) + * @method array mget(array $keys) + * @method mixed mset(array $dictionary) + * @method int msetnx(array $dictionary) + * @method mixed psetex($key, $milliseconds, $value) + * @method mixed set($key, $value, $expireResolution = null, $expireTTL = null, $flag = null) + * @method int setbit($key, $offset, $value) + * @method int setex($key, $seconds, $value) + * @method int setnx($key, $value) + * @method int setrange($key, $offset, $value) + * @method int strlen($key) + * @method int hdel($key, array $fields) + * @method int hexists($key, $field) + * @method string hget($key, $field) + * @method array hgetall($key) + * @method int hincrby($key, $field, $increment) + * @method string hincrbyfloat($key, $field, $increment) + * @method array hkeys($key) + * @method int hlen($key) + * @method array hmget($key, array $fields) + * @method mixed hmset($key, array $dictionary) + * @method array hscan($key, $cursor, array $options = null) + * @method int hset($key, $field, $value) + * @method int hsetnx($key, $field, $value) + * @method array hvals($key) + * @method array blpop(array $keys, $timeout) + * @method array brpop(array $keys, $timeout) + * @method array brpoplpush($source, $destination, $timeout) + * @method string lindex($key, $index) + * @method int linsert($key, $whence, $pivot, $value) + * @method int llen($key) + * @method string lpop($key) + * @method int lpush($key, array $values) + * @method int lpushx($key, $value) + * @method array lrange($key, $start, $stop) + * @method int lrem($key, $count, $value) + * @method mixed lset($key, $index, $value) + * @method mixed ltrim($key, $start, $stop) + * @method string rpop($key) + * @method string rpoplpush($source, $destination) + * @method int rpush($key, array $values) + * @method int rpushx($key, $value) + * @method int sadd($key, array $members) + * @method int scard($key) + * @method array sdiff(array $keys) + * @method int sdiffstore($destination, array $keys) + * @method array sinter(array $keys) + * @method int sinterstore($destination, array $keys) + * @method int sismember($key, $member) + * @method array smembers($key) + * @method int smove($source, $destination, $member) + * @method string spop($key) + * @method string srandmember($key, $count = null) + * @method int srem($key, $member) + * @method array sscan($key, $cursor, array $options = null) + * @method array sunion(array $keys) + * @method int sunionstore($destination, array $keys) + * @method int zadd($key, array $membersAndScoresDictionary) + * @method int zcard($key) + * @method string zcount($key, $min, $max) + * @method int zinterstore($destination, array $keys, array $options = null) + * @method array zrange($key, $start, $stop, array $options = null) + * @method array zrangebyscore($key, $min, $max, array $options = null) + * @method int zrank($key, $member) + * @method int zrem($key, $member) + * @method int zremrangebyrank($key, $start, $stop) + * @method int zremrangebyscore($key, $min, $max) + * @method array zrevrange($key, $start, $stop, array $options = null) + * @method array zrevrangebyscore($key, $min, $max, array $options = null) + * @method int zrevrank($key, $member) + * @method int zunionstore($destination, array $keys, array $options = null) + * @method string zscore($key, $member) + * @method array zscan($key, $cursor, array $options = null) + * @method array zrangebylex($key, $start, $stop, array $options = null) + * @method int zremrangebylex($key, $min, $max) + * @method int zlexcount($key, $min, $max) + * @method int pfadd($key, array $elements) + * @method mixed pfmerge($destinationKey, array $sourceKeys) + * @method int pfcount(array $keys) + * @method mixed pubsub($subcommand, $argument) + * @method int publish($channel, $message) + * @method mixed discard() + * @method array exec() + * @method mixed multi() + * @method mixed unwatch() + * @method mixed watch($key) + * @method mixed eval($script, $numkeys, $keyOrArg1 = null, $keyOrArgN = null) + * @method mixed evalsha($script, $numkeys, $keyOrArg1 = null, $keyOrArgN = null) + * @method mixed script($subcommand, $argument = null) + * @method mixed auth($password) + * @method string echo($message) + * @method mixed ping($message = null) + * @method mixed select($database) + * @method mixed bgrewriteaof() + * @method mixed bgsave() + * @method mixed client($subcommand, $argument = null) + * @method mixed config($subcommand, $argument = null) + * @method int dbsize() + * @method mixed flushall() + * @method mixed flushdb() + * @method array info($section = null) + * @method int lastsave() + * @method mixed save() + * @method mixed slaveof($host, $port) + * @method mixed slowlog($subcommand, $argument = null) + * @method array time() + * @method array command() * * @author Daniele Alessandri */ diff --git a/src/Configuration/Options.php b/src/Configuration/Options.php index ba527cf0..9108d862 100644 --- a/src/Configuration/Options.php +++ b/src/Configuration/Options.php @@ -15,6 +15,8 @@ namespace Predis\Configuration; * Manages Predis options with filtering, conversion and lazy initialization of * values using a mini-DI container approach. * + * {@inheritdoc} + * * @author Daniele Alessandri */ class Options implements OptionsInterface diff --git a/src/Configuration/OptionsInterface.php b/src/Configuration/OptionsInterface.php index 5848fb19..bd529687 100644 --- a/src/Configuration/OptionsInterface.php +++ b/src/Configuration/OptionsInterface.php @@ -12,7 +12,7 @@ namespace Predis\Configuration; /** - * Defines an options container class. + * Interface defining a container for client options. * * @property-read mixed aggregate Custom connection aggregator. * @property-read mixed cluster Aggregate connection for clustering. diff --git a/src/Connection/Parameters.php b/src/Connection/Parameters.php index 4432b9ba..3b946a52 100644 --- a/src/Connection/Parameters.php +++ b/src/Connection/Parameters.php @@ -14,7 +14,9 @@ namespace Predis\Connection; use InvalidArgumentException; /** - * Connection parameters used to initialize connections to Redis. + * Container for connection parameters used to initialize connections to Redis. + * + * {@inheritdoc} * * @author Daniele Alessandri */ diff --git a/src/Connection/ParametersInterface.php b/src/Connection/ParametersInterface.php index faa9c60c..5ec10bf0 100644 --- a/src/Connection/ParametersInterface.php +++ b/src/Connection/ParametersInterface.php @@ -12,7 +12,7 @@ namespace Predis\Connection; /** - * Interface for classes providing their own logic for connection parameters. + * Interface defining a container for connection parameters. * * The actual list of connection parameters depends on the features supported by * each connection backend class (please refer to their specific documentation),