Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Commit

Permalink
docs(Redis): Fix phpdoc for Redis Component
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed Jan 10, 2020
1 parent 657c71a commit 70ac399
Show file tree
Hide file tree
Showing 2 changed files with 182 additions and 153 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<a name="unreleased"></a>
## [Unreleased]

### Chore
- **composer:** bump adhocore/cli (6647c9d)

### Docs
- **Sponsor:** Add Sponsor `MeiHeZi` (ae612e0)

Expand All @@ -20,6 +23,9 @@
### Refactor
- **Entity:** Move Class Torrent,User to namespace App\Entity (7814d88)

### Style
- **gitignore:** Add .php_cs.cache to .gitignore (15a2a15)


<a name="v0.1.6-alpha"></a>
## [v0.1.6-alpha] - 2019-09-20
Expand Down
329 changes: 176 additions & 153 deletions framework/Redis/BaseRedisConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,178 +6,200 @@

/**
* BaseRedis组件
* @link https://github.com/ukko/phpredis-phpdoc/blob/master/src/Redis.php
*
* @method bool psetex($key, $ttl, $value)
* @method array|bool sScan($key, $iterator, $pattern = '', $count = 0)
* @method array|bool scan(&$iterator, $pattern = null, $count = 0)
* @method array|bool zScan($key, $iterator, $pattern = '', $count = 0)
* @method array hScan($key, $iterator, $pattern = '', $count = 0)
* @method mixed client($command, $arg = '')
* @method mixed slowlog($command)
* @method bool open($host, $port = 6379, $timeout = 0.0, $retry_interval = 0)
* @method popen($host, $port = 6379, $timeout = 0.0, $persistent_id = null)
* @method close()
* @method bool setOption($name, $value)
* @method int getOption($name)
* @method bool isConnected()
* @method string|bool getHost()
* @method int|bool getPort()
* @method int|bool getDbNum()
* @method float|bool getTimeout()
* @method float|bool getReadTimeout()
* @method string|null|bool getPersistentID()
* @method string|null|bool getAuth()
* @method bool pconnect(string $host, int $port = 6379, float $timeout = 0.0, string $persistentId = null, int $retryInterval = 0, float $readTimeout = 0.0)
* @method bool popen(string $host, int $port = 6379, float $timeout = 0.0, string $persistentId = '', int $retryInterval = 0, float $readTimeout = 0.0)
* @method bool close()
* @method bool swapdb(int $db1, int $db2)
* @method bool setOption(int $option, mixed $value)
* @method mixed|null getOption(int $option)
* @method string ping()
* @method string|bool get($key)
* @method bool set($key, $value, $timeout = 0)
* @method bool setex($key, $ttl, $value)
* @method bool setnx($key, $value)
* @method int del($key1, $key2 = null, $key3 = null)
* @method int delete($key1, $key2 = null, $key3 = null)
* @method self multi($mode = \Redis::MULTI)
* @method array exec()
* @method string echo (string $message)
* @method string|mixed|bool get(string $key)
* @method bool set(string $key, string|mixed $value, int|array $timeout = null)
* @method bool setex(string $key, int $ttl, string|mixed $value)
* @method bool psetex(string $key, int $ttl, string|mixed $value)
* @method bool setnx(string $key, string|mixed $value)
* @method int del(int|string|array $key1, int|string ...$otherKeys)
* @method int unlink(string|string[] $key1, string $key2 = null, string $key3 = null)
* @method \Redis multi(int $mode = \Redis::MULTI)
* @method void|array exec()
* @method discard()
* @method watch($key)
* @method void watch(string|string[] $key)
* @method unwatch()
* @method subscribe($channels, $callback)
* @method psubscribe($patterns, $callback)
* @method int publish($channel, $message)
* @method array|int pubsub($keyword, $argument)
* @method bool exists($key)
* @method int incr($key)
* @method float incrByFloat($key, $increment)
* @method int incrBy($key, $value)
* @method int decr($key)
* @method int decrBy($key, $value)
* @method array getMultiple(array $keys)
* @method int|bool lPush($key, $value1, $value2 = null, $valueN = null)
* @method int|bool rPush($key, $value1, $value2 = null, $valueN = null)
* @method int lPushx($key, $value)
* @method int rPushx($key, $value)
* @method mixed lPop($key)
* @method mixed rPop($key)
* @method array blPop(array $keys, $timeout)
* @method array brPop(array $keys, $timeout)
* @method int lLen($key)
* @method lSize($key)
* @method lIndex($key, $index)
* @method lGet($key, $index)
* @method lSet($key, $index, $value)
* @method array lRange($key, $start, $end)
* @method lGetRange($key, $start, $end)
* @method array lTrim($key, $start, $stop)
* @method listTrim($key, $start, $stop)
* @method int lRem($key, $value, $count)
* @method lRemove($key, $value, $count)
* @method int lInsert($key, $position, $pivot, $value)
* @method int sAdd($key, $value1, $value2 = null, $valueN = null)
* @method sAddArray($key, array $values)
* @method int sRem($key, $member1, $member2 = null, $memberN = null)
* @method sRemove($key, $member1, $member2 = null, $memberN = null)
* @method bool sMove($srcKey, $dstKey, $member)
* @method bool sIsMember($key, $value)
* @method sContains($key, $value)
* @method int sCard($key)
* @method string sPop($key)
* @method string|array sRandMember($key, $count = null)
* @method array sInter($key1, $key2, $keyN = null)
* @method int sInterStore($dstKey, $key1, $key2, $keyN = null)
* @method array sUnion($key1, $key2, $keyN = null)
* @method int sUnionStore($dstKey, $key1, $key2, $keyN = null)
* @method array sDiff($key1, $key2, $keyN = null)
* @method int sDiffStore($dstKey, $key1, $key2, $keyN = null)
* @method array sMembers($key)
* @method sGetMembers($key)
* @method string getSet($key, $value)
* @method mixed|null subscribe(string[] $channels, string|array $callback)
* @method psubscribe(array $patterns, string|array $callback)
* @method int publish(string $channel, string $message)
* @method array|int pubsub(string $keyword, string|array $argument)
* @method unsubscribe(array $channels = null)
* @method punsubscribe(array $patterns = null)
* @method int|bool exists(string|string[] $key)
* @method int incr(string $key)
* @method float incrByFloat(string $key, float $increment)
* @method int incrBy(string $key, int $value)
* @method int decr(string $key)
* @method int decrBy(string $key, int $value)
* @method int|bool lPush(string $key, string|mixed ...$value1)
* @method int|bool rPush(string $key, string|mixed ...$value1)
* @method int|bool lPushx(string $key, string|mixed $value)
* @method int|bool rPushx(string $key, string|mixed $value)
* @method mixed|bool lPop(string $key)
* @method mixed|bool rPop(string $key)
* @method array blPop(string|string[] $keys, int $timeout)
* @method array brPop(string|string[] $keys, int $timeout)
* @method int|bool lLen(string $key)
* @method int lSize(string $key)
* @method mixed|bool lIndex(string $key, int $index)
* @method mixed|bool lGet(string $key, int $index)
* @method bool lSet(string $key, int $index, string $value)
* @method array lRange(string $key, int $start, int $end)
* @method array|bool lTrim(string $key, int $start, int $stop)
* @method int|bool lRem(string $key, string $value, int $count)
* @method int lInsert(string $key, int $position, string $pivot, string|mixed $value)
* @method int|bool sAdd(string $key, string|mixed ...$value1)
* @method int sRem(string $key, string|mixed ...$member1)
* @method bool sMove(string $srcKey, string $dstKey, string|mixed $member)
* @method bool sIsMember(string $key, string|mixed $value)
* @method int sCard(string $key)
* @method string|mixed|array|bool sPop(string $key, int $count = 1)
* @method string|mixed|array|bool sRandMember(string $key, int $count = 1)
* @method array sInter(string $key1, string ...$otherKeys)
* @method int|bool sInterStore(string $dstKey, string $key1, string ...$otherKeys)
* @method array sUnion(string $key1, string ...$otherKeys)
* @method int sUnionStore(string $dstKey, string $key1, string ...$otherKeys)
* @method array sDiff(string $key1, string ...$otherKeys)
* @method int|bool sDiffStore(string $dstKey, string $key1, string ...$otherKeys)
* @method array sMembers(string $key)
* @method array|bool sScan(string $key, int &$iterator, string $pattern = null, int $count = 0)
* @method string|mixed getSet(string $key, string|mixed $value)
* @method string randomKey()
* @method bool select($dbindex)
* @method bool move($key, $dbindex)
* @method bool rename($srcKey, $dstKey)
* @method renameKey($srcKey, $dstKey)
* @method bool renameNx($srcKey, $dstKey)
* @method bool expire($key, $ttl)
* @method bool pExpire($key, $ttl)
* @method setTimeout($key, $ttl)
* @method bool expireAt($key, $timestamp)
* @method bool pExpireAt($key, $timestamp)
* @method array keys($pattern)
* @method getKeys($pattern)
* @method bool select(int $dbIndex)
* @method bool move(string $key, int $dbIndex)
* @method bool rename(string $srcKey, string $dstKey)
* @method bool renameNx(string $srcKey, string $dstKey)
* @method bool expire(string $key, int $ttl)
* @method bool pExpire(string $key, int $ttl)
* @method bool expireAt(string $key, int $timestamp)
* @method bool pExpireAt(string $key, int $timestamp)
* @method array keys(string $pattern)
* @method int dbSize()
* @method bool auth($password)
* @method bool auth(string $password)
* @method bool bgrewriteaof()
* @method bool slaveof($host = '127.0.0.1', $port = 6379)
* @method string object($string = '', $key = '')
* @method bool slaveof(string $host = '127.0.0.1', int $port = 6379)
* @method mixed slowLog(string $operation, int $length = null)
* @method string|int|bool object(string $string = '', string $key = '')
* @method bool save()
* @method bool bgsave()
* @method int lastSave()
* @method int wait($numSlaves, $timeout)
* @method int type($key)
* @method int append($key, $value)
* @method string getRange($key, $start, $end)
* @method substr($key, $start, $end)
* @method string setRange($key, $offset, $value)
* @method int strlen($key)
* @method int bitpos($key, $bit, $start = 0, $end = null)
* @method int getBit($key, $offset)
* @method int setBit($key, $offset, $value)
* @method int bitCount($key)
* @method int bitOp($operation, $retKey, ...$keys)
* @method int wait(int $numSlaves, int $timeout)
* @method int type(string $key)
* @method int append(string $key, string|mixed $value)
* @method string getRange(string $key, int $start, int $end)
* @method string substr(string $key, int $start, int $end)
* @method int setRange(string $key, int $offset, string $value)
* @method int strlen(string $key)
* @method int bitpos(string $key, int $bit, int $start = 0, int $end = null)
* @method int getBit(string $key, int $offset)
* @method int setBit(string $key, int $offset, bool|int $value)
* @method int bitCount(string $key)
* @method int bitOp(string $operation, string $retKey, string $key1, string ...$otherKeys)
* @method bool flushDB()
* @method bool flushAll()
* @method array sort($key, $option = null)
* @method array|string info($option = null)
* @method array sort(string $key, array $option = null)
* @method string info(string $option = null)
* @method bool resetStat()
* @method int ttl($key)
* @method int pttl($key)
* @method bool persist($key)
* @method int|bool ttl(string $key)
* @method int|bool pttl(string $key)
* @method bool persist(string $key)
* @method bool mset(array $array)
* @method array mget(array $array)
* @method int msetnx(array $array)
* @method string rpoplpush($srcKey, $dstKey)
* @method mixed brpoplpush($srcKey, $dstKey, $timeout)
* @method int zAdd($key, $score1, $value1, $score2 = null, $value2 = null, $scoreN = null, $valueN = null)
* @method array zRange($key, $start, $end, $withscores = null)
* @method int zRem($key, $member1, $member2 = null, $memberN = null)
* @method int zDelete($key, $member1, $member2 = null, $memberN = null)
* @method array zRevRange($key, $start, $end, $withscore = null)
* @method array zRangeByScore($key, $start, $end, array $options = [])
* @method array zRevRangeByScore($key, $start, $end, array $options = [])
* @method array zRangeByLex($key, $min, $max, $offset = null, $limit = null)
* @method array zRevRangeByLex($key, $min, $max, $offset = null, $limit = null)
* @method int zCount($key, $start, $end)
* @method int zRemRangeByScore($key, $start, $end)
* @method zDeleteRangeByScore($key, $start, $end)
* @method int zRemRangeByRank($key, $start, $end)
* @method zDeleteRangeByRank($key, $start, $end)
* @method int zCard($key)
* @method zSize($key)
* @method float zScore($key, $member)
* @method int zRank($key, $member)
* @method int zRevRank($key, $member)
* @method float zIncrBy($key, $value, $member)
* @method int zUnion($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM')
* @method int zInter($Output, $ZSetKeys, array $Weights = null, $aggregateFunction = 'SUM')
* @method int|bool hSet($key, $hashKey, $value)
* @method bool hSetNx($key, $hashKey, $value)
* @method string|bool hGet($key, $hashKey)
* @method int hLen($key)
* @method int|bool hDel($key, $hashKey1, $hashKey2 = null, $hashKeyN = null)
* @method array hKeys($key)
* @method array hVals($key)
* @method array hGetAll($key)
* @method bool hExists($key, $hashKey)
* @method int hIncrBy($key, $hashKey, $value)
* @method float hIncrByFloat($key, $field, $increment)
* @method bool hMSet($key, $hashKeys)
* @method array hMGet($key, $hashKeys)
* @method array config($operation, $key, $value)
* @method mixed evaluate($script, $args = [], $numKeys = 0)
* @method mixed evalSha($scriptSha, $args = [], $numKeys = 0)
* @method evaluateSha($scriptSha, $args = [], $numKeys = 0)
* @method mixed script($command, $script)
* @method string|mixed|bool rpoplpush(string $srcKey, string $dstKey)
* @method string|mixed|bool brpoplpush(string $srcKey, string $dstKey, int $timeout)
* @method int zAdd(string $key, float $score1, string|mixed $value1, float $score2 = null, string|mixed $value2 = null, float $scoreN = null, string|mixed $valueN = null)
* @method array zRange(string $key, int $start, int $end, bool $withscores = null)
* @method int zRem(string $key, string|mixed $member1, string|mixed ...$otherMembers)
* @method array zRevRange(string $key, int $start, int $end, bool $withscore = null)
* @method array zRangeByScore(string $key, int $start, int $end, array $options = array())
* @method array zRevRangeByScore(string $key, int $start, int $end, array $options = array())
* @method array|bool zRangeByLex(string $key, int $min, int $max, int $offset = null, int $limit = null)
* @method array|bool zRevRangeByLex(string $key, int $min, int $max, int $offset = null, int $limit = null)
* @method int zCount(string $key, string $start, string $end)
* @method int zRemRangeByScore(string $key, float|string $start, float|string $end)
* @method int zRemRangeByRank(string $key, int $start, int $end)
* @method int zCard(string $key)
* @method float|bool zScore(string $key, string|mixed $member)
* @method int|bool zRank(string $key, string|mixed $member)
* @method int|bool zRevRank(string $key, string|mixed $member)
* @method float zIncrBy(string $key, float $value, string $member)
* @method int zUnionStore(string $output, array $zSetKeys, array $weights = null, string $aggregateFunction = 'SUM')
* @method int zInterStore(string $output, array $zSetKeys, array $weights = null, string $aggregateFunction = 'SUM')
* @method array|bool zScan(string $key, int &$iterator, string $pattern = null, int $count = 0)
* @method array bzPopMax(string|array $key1, string|array $key2, int $timeout)
* @method array bzPopMin(string|array $key1, string|array $key2, int $timeout)
* @method array zPopMax(string $key, int $count = 1)
* @method array zPopMin(string $key, int $count = 1)
* @method int|bool hSet(string $key, string $hashKey, string $value)
* @method bool hSetNx(string $key, string $hashKey, string $value)
* @method string hGet(string $key, string $hashKey)
* @method int|bool hLen(string $key)
* @method int|bool hDel(string $key, string $hashKey1, string ...$otherHashKeys)
* @method array hKeys(string $key)
* @method array hVals(string $key)
* @method array hGetAll(string $key)
* @method bool hExists(string $key, string $hashKey)
* @method int hIncrBy(string $key, string $hashKey, int $value)
* @method float hIncrByFloat(string $key, string $field, float $increment)
* @method bool hMSet(string $key, array $hashKeys)
* @method array hMGet(string $key, array $hashKeys)
* @method array hScan(string $key, int &$iterator, string $pattern = null, int $count = 0)
* @method int hStrLen(string $key, string $field)
* @method int geoadd(string $key, float $longitude, float $latitude, string $member)
* @method array geohash(string $key, string ...$member)
* @method array geopos(string $key, string $member)
* @method float geodist(string $key, string $member1, string $member2, string $unit = null)
* @method georadius($key, $longitude, $latitude, $radius, $unit, array|null $options = null)
* @method georadiusbymember(string $key, string $member, $radius, $units, array|null $options = null)
* @method array config(string $operation, string $key, string|mixed $value)
* @method mixed eval(string $script, array $args = array(), int $numKeys = 0)
* @method mixed evalSha(string $scriptSha, array $args = array(), int $numKeys = 0)
* @method mixed script(string $command, string $script)
* @method string|null getLastError()
* @method bool clearLastError()
* @method string dump($key)
* @method bool restore($key, $ttl, $value)
* @method bool migrate($host, $port, $key, $db, $timeout, $copy = false, $replace = false)
* @method mixed client(string $command, string $value = '')
* @method string|bool dump(string $key)
* @method bool restore(string $key, int $ttl, string $value)
* @method bool migrate(string $host, int $port, string $key, int $db, int $timeout, bool $copy = false, bool $replace = false)
* @method array time()
* @method bool pfAdd($key, array $elements)
* @method int pfCount($key)
* @method bool pfMerge($destkey, array $sourcekeys)
* @method mixed rawCommand($command, $arguments)
* @method array|bool scan(int &$iterator, string $pattern = null, int $count = 0)
* @method bool pfAdd(string $key, array $elements)
* @method int pfCount(string|array $key)
* @method bool pfMerge(string $destKey, array $sourceKeys)
* @method mixed rawCommand(string $command, mixed $arguments)
* @method int getMode()
* @method int xAck(string $stream, string $group, array $messages)
* @method string xAdd(string $key, string $id, array $messages, int $maxLen = 0, bool $isApproximate = false)
* @method array xClaim(string $key, string $group, string $consumer, int $minIdleTime, array $ids, array $options = [])
* @method int xDel(string $key, array $ids)
* @method mixed xGroup(string $operation, string $key, string $group, string $msgId = '', bool $mkStream = false)
* @method mixed xInfo(string $operation, string $stream, string $group)
* @method int xLen(string $stream)
* @method array xPending(string $stream, string $group, string $start = null, string $end = null, int $count = null, string $consumer = null)
* @method array xRange(string $stream, string $start, string $end, int $count = null)
* @method array xRead(array $streams, int|string $count = null, int|string $block = null)
* @method array xReadGroup(string $group, string $consumer, array $streams, int|null $count = null, int|null $block = null)
* @method array xRevRange(string $stream, string $end, string $start, int $count = null)
* @method int xTrim(string $stream, int $maxLen, bool $isApproximate)
* @method int|bool sAddArray(string $key, array $values)
*/
class BaseRedisConnection extends Component
{
Expand Down Expand Up @@ -288,7 +310,8 @@ public function __call($name, $arguments)
return call_user_func_array([$this->_redis, $name], $arguments); // 执行命令
}

public function multiDelete($pattern) {
public function multiDelete($pattern)
{
return $this->del($this->keys($pattern));
}

Expand Down

0 comments on commit 70ac399

Please sign in to comment.