Skip to content

Commit

Permalink
Revert "Sync branch with 2.x (#1169)" (#1170)
Browse files Browse the repository at this point in the history
This reverts commit bc5f07d.
  • Loading branch information
vladvildanov committed Feb 21, 2023
1 parent bc5f07d commit f9f0d4a
Show file tree
Hide file tree
Showing 53 changed files with 22 additions and 2,126 deletions.
31 changes: 0 additions & 31 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
use IteratorAggregate;
use Predis\Command\CommandInterface;
use Predis\Command\RawCommand;
use Predis\Command\Redis\Container\ContainerFactory;
use Predis\Command\Redis\Container\ContainerInterface;
use Predis\Command\ScriptCommand;
use Predis\Configuration\Options;
use Predis\Configuration\OptionsInterface;
Expand All @@ -33,7 +31,6 @@
use Predis\Response\ServerException;
use Predis\Transaction\MultiExec as MultiExecTransaction;
use ReturnTypeWillChange;
use RuntimeException;
use Traversable;

/**
Expand Down Expand Up @@ -313,34 +310,6 @@ public function createCommand($commandID, $arguments = [])
return $this->commands->create($commandID, $arguments);
}

/**
* @param $name
* @return ContainerInterface
*/
public function __get($name)
{
return ContainerFactory::create($this, $name);
}

/**
* @param $name
* @param $value
* @return mixed
*/
public function __set($name, $value)
{
throw new RuntimeException('Not allowed');
}

/**
* @param $name
* @return mixed
*/
public function __isset($name)
{
throw new RuntimeException('Not allowed');
}

/**
* {@inheritdoc}
*/
Expand Down
15 changes: 4 additions & 11 deletions src/ClientContextInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@

use Predis\Command\Argument\Geospatial\ByInterface;
use Predis\Command\Argument\Geospatial\FromInterface;
use Predis\Command\Argument\Server\LimitOffsetCount;
use Predis\Command\Argument\Server\To;
use Predis\Command\CommandInterface;
use Predis\Command\Redis\Container\FunctionContainer;

/**
* Interface defining a client-side context such as a pipeline or transaction.
Expand All @@ -26,8 +24,8 @@
* @method $this del(array|string $keys)
* @method $this dump($key)
* @method $this exists($key)
* @method $this expire($key, $seconds, string $expireOption = '')
* @method $this expireat($key, $timestamp, string $expireOption = '')
* @method $this expire($key, $seconds)
* @method $this expireat($key, $timestamp)
* @method $this expiretime(string $key)
* @method $this keys($pattern)
* @method $this move($key, $db)
Expand All @@ -41,11 +39,9 @@
* @method $this renamenx($key, $target)
* @method $this scan($cursor, array $options = null)
* @method $this sort($key, array $options = null)
* @method $this sort_ro(string $key, ?string $byPattern = null, ?LimitOffsetCount $limit = null, array $getPatterns = [], ?string $sorting = null, bool $alpha = false)
* @method $this ttl($key)
* @method $this type($key)
* @method $this append($key, $value)
* @method $this bitcount($key, $start = null, $end = null, string $index = 'byte')
* @method $this bfadd(string $key, $item)
* @method $this bfexists(string $key, $item)
* @method $this bfinfo(string $key, string $modifier = '')
Expand All @@ -55,9 +51,10 @@
* @method $this bfmexists(string $key, ...$item)
* @method $this bfreserve(string $key, float $errorRate, int $capacity, int $expansion = -1, bool $nonScaling = false)
* @method $this bfscandump(string $key, int $iterator)
* @method $this bitcount($key, $start = null, $end = null)
* @method $this bitop($operation, $destkey, $key)
* @method $this bitfield($key, $subcommand, ...$subcommandArg)
* @method $this bitpos($key, $bit, $start = null, $end = null, string $index = 'byte')
* @method $this bitpos($key, $bit, $start = null, $end = null)
* @method $this blmpop(int $timeout, array $keys, string $modifier = 'left', int $count = 1)
* @method $this bzpopmax(array $keys, int $timeout)
* @method $this bzpopmin(array $keys, int $timeout)
Expand All @@ -83,7 +80,6 @@
* @method $this decr($key)
* @method $this decrby($key, $decrement)
* @method $this failover(?To $to = null, bool $abort = false, int $timeout = -1)
* @method $this fcall(string $function, array $keys, ...$args)
* @method $this get($key)
* @method $this getbit($key, $offset)
* @method $this getex(string $key, $modifier = '', $value = false)
Expand Down Expand Up @@ -269,9 +265,6 @@
* @method $this georadiusbymember($key, $member, $radius, $unit, array $options = null)
* @method $this geosearch(string $key, FromInterface $from, ByInterface $by, ?string $sorting = null, int $count = -1, bool $any = false, bool $withCoord = false, bool $withDist = false, bool $withHash = false)
* @method $this geosearchstore(string $destination, string $source, FromInterface $from, ByInterface $by, ?string $sorting = null, int $count = -1, bool $any = false, bool $storeDist = false)
*
* Container commands
* @property FunctionContainer $function
*/
interface ClientContextInterface
{
Expand Down
15 changes: 4 additions & 11 deletions src/ClientInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@

use Predis\Command\Argument\Geospatial\ByInterface;
use Predis\Command\Argument\Geospatial\FromInterface;
use Predis\Command\Argument\Server\LimitOffsetCount;
use Predis\Command\Argument\Server\To;
use Predis\Command\CommandInterface;
use Predis\Command\FactoryInterface;
use Predis\Command\Redis\Container\FunctionContainer;
use Predis\Configuration\OptionsInterface;
use Predis\Connection\ConnectionInterface;
use Predis\Response\Status;
Expand All @@ -35,8 +33,8 @@
* @method int del(string[]|string $keyOrKeys, string ...$keys = null)
* @method string|null dump(string $key)
* @method int exists(string $key)
* @method int expire(string $key, int $seconds, string $expireOption = '')
* @method int expireat(string $key, int $timestamp, string $expireOption = '')
* @method int expire(string $key, int $seconds)
* @method int expireat(string $key, int $timestamp)
* @method int expiretime(string $key)
* @method array keys(string $pattern)
* @method int move(string $key, int $db)
Expand All @@ -50,11 +48,9 @@
* @method int renamenx(string $key, string $target)
* @method array scan($cursor, array $options = null)
* @method array sort(string $key, array $options = null)
* @method array sort_ro(string $key, ?string $byPattern = null, ?LimitOffsetCount $limit = null, array $getPatterns = [], ?string $sorting = null, bool $alpha = false)
* @method int ttl(string $key)
* @method mixed type(string $key)
* @method int append(string $key, $value)
* @method int bitcount(string $key, $start = null, $end = null, string $index = 'byte')
* @method int bfadd(string $key, $item)
* @method int bfexists(string $key, $item)
* @method array bfinfo(string $key, string $modifier = '')
Expand All @@ -64,9 +60,10 @@
* @method array bfmexists(string $key, ...$item)
* @method Status bfreserve(string $key, float $errorRate, int $capacity, int $expansion = -1, bool $nonScaling = false)
* @method array bfscandump(string $key, int $iterator)
* @method int bitcount(string $key, $start = null, $end = null)
* @method int bitop($operation, $destkey, $key)
* @method array|null bitfield(string $key, $subcommand, ...$subcommandArg)
* @method int bitpos(string $key, $bit, $start = null, $end = null, string $index = 'byte')
* @method int bitpos(string $key, $bit, $start = null, $end = null)
* @method array blmpop(int $timeout, array $keys, string $modifier = 'left', int $count = 1)
* @method array bzpopmax(array $keys, int $timeout)
* @method array bzpopmin(array $keys, int $timeout)
Expand All @@ -92,7 +89,6 @@
* @method int decr(string $key)
* @method int decrby(string $key, int $decrement)
* @method Status failover(?To $to = null, bool $abort = false, int $timeout = -1)
* @method mixed fcall(string $function, array $keys, ...$args)
* @method string|null get(string $key)
* @method int getbit(string $key, $offset)
* @method int|null getex(string $key, $modifier = '', $value = false)
Expand Down Expand Up @@ -287,9 +283,6 @@
* @method array georadiusbymember(string $key, $member, $radius, $unit, array $options = null)
* @method array geosearch(string $key, FromInterface $from, ByInterface $by, ?string $sorting = null, int $count = -1, bool $any = false, bool $withCoord = false, bool $withDist = false, bool $withHash = false)
* @method int geosearchstore(string $destination, string $source, FromInterface $from, ByInterface $by, ?string $sorting = null, int $count = -1, bool $any = false, bool $storeDist = false)
*
* Container commands
* @property FunctionContainer $function
*/
interface ClientInterface
{
Expand Down
19 changes: 0 additions & 19 deletions src/Command/Argument/Server/LimitInterface.php

This file was deleted.

42 changes: 0 additions & 42 deletions src/Command/Argument/Server/LimitOffsetCount.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Command/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static function normalizeVariadic(array $arguments)
public function filterArguments(): void
{
$this->arguments = array_filter($this->arguments, static function ($argument) {
return $argument !== false && $argument !== null;
return $argument !== false;
});
}
}
6 changes: 0 additions & 6 deletions src/Command/Processor/KeyPrefixProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,6 @@ public function __construct($prefix)
'GEODIST' => $prefixFirst,
'GEORADIUS' => $prefixGeoradius,
'GEORADIUSBYMEMBER' => $prefixGeoradius,
/* ---------------- Redis 5.0 ---------------- */
'XADD' => $prefixFirst,
'XRANGE' => $prefixFirst,
'XDEL' => $prefixFirst,
'XLEN' => $prefixFirst,
'XACK' => $prefixFirst,
];
}

Expand Down
5 changes: 0 additions & 5 deletions src/Command/Redis/BITCOUNT.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@
namespace Predis\Command\Redis;

use Predis\Command\Command as RedisCommand;
use Predis\Command\Traits\BitByte;

/**
* @see http://redis.io/commands/bitcount
*
* Count the number of set bits (population counting) in a string.
*/
class BITCOUNT extends RedisCommand
{
use BitByte;

/**
* {@inheritdoc}
*/
Expand Down
5 changes: 0 additions & 5 deletions src/Command/Redis/BITPOS.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@
namespace Predis\Command\Redis;

use Predis\Command\Command as RedisCommand;
use Predis\Command\Traits\BitByte;

/**
* @see http://redis.io/commands/bitpos
*
* Return the position of the first bit set to 1 or 0 in a string.
*/
class BITPOS extends RedisCommand
{
use BitByte;

/**
* {@inheritdoc}
*/
Expand Down
42 changes: 0 additions & 42 deletions src/Command/Redis/Container/AbstractContainer.php

This file was deleted.

54 changes: 0 additions & 54 deletions src/Command/Redis/Container/ContainerFactory.php

This file was deleted.

Loading

0 comments on commit f9f0d4a

Please sign in to comment.