diff --git a/Adapter/DoctrineDbalAdapter.php b/Adapter/DoctrineDbalAdapter.php index 806eba40..25f85d77 100644 --- a/Adapter/DoctrineDbalAdapter.php +++ b/Adapter/DoctrineDbalAdapter.php @@ -309,6 +309,22 @@ protected function doSave(array $values, int $lifetime): array|bool return $failed; } + /** + * @internal + */ + protected function getId($key) + { + if ('pgsql' !== $this->platformName ??= $this->getPlatformName()) { + return parent::getId($key); + } + + if (str_contains($key, "\0") || str_contains($key, '%') || !preg_match('//u', $key)) { + $key = rawurlencode($key); + } + + return parent::getId($key); + } + private function getPlatformName(): string { if (isset($this->platformName)) { diff --git a/Adapter/MemcachedAdapter.php b/Adapter/MemcachedAdapter.php index e3765469..8c794950 100644 --- a/Adapter/MemcachedAdapter.php +++ b/Adapter/MemcachedAdapter.php @@ -32,13 +32,6 @@ class MemcachedAdapter extends AbstractAdapter protected $maxIdLength = 250; - private const DEFAULT_CLIENT_OPTIONS = [ - 'persistent_id' => null, - 'username' => null, - 'password' => null, - \Memcached::OPT_SERIALIZER => \Memcached::SERIALIZER_PHP, - ]; - private MarshallerInterface $marshaller; private \Memcached $client; private \Memcached $lazyClient; @@ -102,10 +95,9 @@ public static function createConnection(array|string $servers, array $options = } set_error_handler(function ($type, $msg, $file, $line) { throw new \ErrorException($msg, 0, $type, $file, $line); }); try { - $options += static::DEFAULT_CLIENT_OPTIONS; - $client = new \Memcached($options['persistent_id']); - $username = $options['username']; - $password = $options['password']; + $client = new \Memcached($options['persistent_id'] ?? null); + $username = $options['username'] ?? null; + $password = $options['password'] ?? null; // parse any DSN in $servers foreach ($servers as $i => $dsn) { @@ -195,7 +187,7 @@ public static function createConnection(array|string $servers, array $options = $options[\constant('Memcached::OPT_'.$name)] = $value; } } - $client->setOptions($options); + $client->setOptions($options + [\Memcached::OPT_SERIALIZER => \Memcached::SERIALIZER_PHP]); // set client's servers, taking care of persistent connections if (!$client->isPristine()) { diff --git a/Adapter/PdoAdapter.php b/Adapter/PdoAdapter.php index 355efbe8..baee284a 100644 --- a/Adapter/PdoAdapter.php +++ b/Adapter/PdoAdapter.php @@ -336,6 +336,22 @@ protected function doSave(array $values, int $lifetime): array|bool return $failed; } + /** + * @internal + */ + protected function getId($key) + { + if ('pgsql' !== $this->driver ??= ($this->getConnection() ? $this->driver : null)) { + return parent::getId($key); + } + + if (str_contains($key, "\0") || str_contains($key, '%') || !preg_match('//u', $key)) { + $key = rawurlencode($key); + } + + return parent::getId($key); + } + private function getConnection(): \PDO { if (!isset($this->conn)) { diff --git a/Adapter/PhpFilesAdapter.php b/Adapter/PhpFilesAdapter.php index fa4c0aca..99657b00 100644 --- a/Adapter/PhpFilesAdapter.php +++ b/Adapter/PhpFilesAdapter.php @@ -79,7 +79,7 @@ public function prune(): bool } if ($time >= $expiresAt) { - $pruned = $this->doUnlink($file) && !file_exists($file) && $pruned; + $pruned = ($this->doUnlink($file) || !file_exists($file)) && $pruned; } } } finally { diff --git a/LICENSE b/LICENSE index f2345234..0223acd4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2016-2023 Fabien Potencier +Copyright (c) 2016-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Messenger/EarlyExpirationHandler.php b/Messenger/EarlyExpirationHandler.php index 9d2aaecc..38b594c2 100644 --- a/Messenger/EarlyExpirationHandler.php +++ b/Messenger/EarlyExpirationHandler.php @@ -73,7 +73,8 @@ function (CacheItem $item, float $startTime) { $startTime = microtime(true); $pool = $message->findPool($this->reverseContainer); $callback = $message->findCallback($this->reverseContainer); - $value = $callback($item); + $save = true; + $value = $callback($item, $save); $setMetadata($item, $startTime); $pool->save($item->set($value)); } diff --git a/Tests/Adapter/AbstractRedisAdapterTest.php b/Tests/Adapter/AbstractRedisAdapterTestCase.php similarity index 96% rename from Tests/Adapter/AbstractRedisAdapterTest.php rename to Tests/Adapter/AbstractRedisAdapterTestCase.php index a1e8d19e..10382178 100644 --- a/Tests/Adapter/AbstractRedisAdapterTest.php +++ b/Tests/Adapter/AbstractRedisAdapterTestCase.php @@ -15,7 +15,7 @@ use Psr\Cache\CacheItemPoolInterface; use Symfony\Component\Cache\Adapter\RedisAdapter; -abstract class AbstractRedisAdapterTest extends AdapterTestCase +abstract class AbstractRedisAdapterTestCase extends AdapterTestCase { protected $skippedTests = [ 'testExpiration' => 'Testing expiration slows down the test suite', diff --git a/Tests/Adapter/ChainAdapterTest.php b/Tests/Adapter/ChainAdapterTest.php index 79f0719f..a72b783b 100644 --- a/Tests/Adapter/ChainAdapterTest.php +++ b/Tests/Adapter/ChainAdapterTest.php @@ -25,6 +25,7 @@ /** * @author Kévin Dunglas + * * @group time-sensitive */ class ChainAdapterTest extends AdapterTestCase @@ -213,7 +214,7 @@ public function testExpirationOnAllAdapters() $adapter1 = $this->getMockBuilder(FilesystemAdapter::class) ->setConstructorArgs(['', 2]) - ->setMethods(['save']) + ->onlyMethods(['save']) ->getMock(); $adapter1->expects($this->once()) ->method('save') @@ -222,7 +223,7 @@ public function testExpirationOnAllAdapters() $adapter2 = $this->getMockBuilder(FilesystemAdapter::class) ->setConstructorArgs(['', 4]) - ->setMethods(['save']) + ->onlyMethods(['save']) ->getMock(); $adapter2->expects($this->once()) ->method('save') diff --git a/Tests/Adapter/CouchbaseBucketAdapterTest.php b/Tests/Adapter/CouchbaseBucketAdapterTest.php index 22811f5e..11ca665c 100644 --- a/Tests/Adapter/CouchbaseBucketAdapterTest.php +++ b/Tests/Adapter/CouchbaseBucketAdapterTest.php @@ -19,6 +19,7 @@ /** * @requires extension couchbase <3.0.0 * @requires extension couchbase >=2.6.0 + * * @group integration * * @author Antonio Jose Cerezo Aranda diff --git a/Tests/Adapter/CouchbaseCollectionAdapterTest.php b/Tests/Adapter/CouchbaseCollectionAdapterTest.php index be5b2ea6..192bc00e 100644 --- a/Tests/Adapter/CouchbaseCollectionAdapterTest.php +++ b/Tests/Adapter/CouchbaseCollectionAdapterTest.php @@ -19,6 +19,7 @@ /** * @requires extension couchbase <4.0.0 * @requires extension couchbase >=3.0.0 + * * @group integration * * @author Antonio Jose Cerezo Aranda diff --git a/Tests/Adapter/DoctrineDbalAdapterTest.php b/Tests/Adapter/DoctrineDbalAdapterTest.php index 67f14fd6..3d5bdde8 100644 --- a/Tests/Adapter/DoctrineDbalAdapterTest.php +++ b/Tests/Adapter/DoctrineDbalAdapterTest.php @@ -124,7 +124,7 @@ public function testDsn(string $dsn, string $file = null) } } - public function provideDsn() + public static function provideDsn() { $dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache'); yield ['sqlite://localhost/'.$dbFile.'1', $dbFile.'1']; diff --git a/Tests/Adapter/MaxIdLengthAdapterTest.php b/Tests/Adapter/MaxIdLengthAdapterTest.php index 7f91101e..d6a76ee2 100644 --- a/Tests/Adapter/MaxIdLengthAdapterTest.php +++ b/Tests/Adapter/MaxIdLengthAdapterTest.php @@ -21,15 +21,23 @@ public function testLongKey() { $cache = $this->getMockBuilder(MaxIdLengthAdapter::class) ->setConstructorArgs([str_repeat('-', 10)]) - ->setMethods(['doHave', 'doFetch', 'doDelete', 'doSave', 'doClear']) + ->onlyMethods(['doHave', 'doFetch', 'doDelete', 'doSave', 'doClear']) ->getMock(); $cache->expects($this->exactly(2)) ->method('doHave') - ->withConsecutive( - [$this->equalTo('----------:nWfzGiCgLczv3SSUzXL3kg:')], - [$this->equalTo('----------:---------------------------------------')] - )->willReturn(false); + ->willReturnCallback(function (...$args) { + static $series = [ + ['----------:nWfzGiCgLczv3SSUzXL3kg:'], + ['----------:---------------------------------------'], + ]; + + $expectedArgs = array_shift($series); + $this->assertSame($expectedArgs, $args); + + return false; + }) + ; $cache->hasItem(str_repeat('-', 40)); $cache->hasItem(str_repeat('-', 39)); diff --git a/Tests/Adapter/MemcachedAdapterTest.php b/Tests/Adapter/MemcachedAdapterTest.php index 0cbe628c..5f5f0554 100644 --- a/Tests/Adapter/MemcachedAdapterTest.php +++ b/Tests/Adapter/MemcachedAdapterTest.php @@ -79,7 +79,7 @@ public function testBadOptions($name, $value) MemcachedAdapter::createConnection([], [$name => $value]); } - public function provideBadOptions(): array + public static function provideBadOptions(): array { return [ ['hash', 'zyx'], @@ -130,7 +130,7 @@ public function testServersSetting(string $dsn, string $host, int $port) $this->assertSame([$expect], array_map($f, $client3->getServerList())); } - public function provideServersSetting(): iterable + public static function provideServersSetting(): iterable { yield [ 'memcached://127.0.0.1/50', @@ -180,7 +180,7 @@ public function testDsnWithOptions(string $dsn, array $options, array $expectedO } } - public function provideDsnWithOptions(): iterable + public static function provideDsnWithOptions(): iterable { if (!class_exists(\Memcached::class)) { self::markTestSkipped('Extension memcached required.'); diff --git a/Tests/Adapter/PdoAdapterTest.php b/Tests/Adapter/PdoAdapterTest.php index 9752faab..83210869 100644 --- a/Tests/Adapter/PdoAdapterTest.php +++ b/Tests/Adapter/PdoAdapterTest.php @@ -89,7 +89,7 @@ public function testDsn(string $dsn, string $file = null) } } - public function provideDsn() + public static function provideDsn() { $dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache'); yield ['sqlite:'.$dbFile.'2', $dbFile.'2']; diff --git a/Tests/Adapter/PredisAdapterSentinelTest.php b/Tests/Adapter/PredisAdapterSentinelTest.php index a3d0cf36..c3145b9e 100644 --- a/Tests/Adapter/PredisAdapterSentinelTest.php +++ b/Tests/Adapter/PredisAdapterSentinelTest.php @@ -17,7 +17,7 @@ /** * @group integration */ -class PredisAdapterSentinelTest extends AbstractRedisAdapterTest +class PredisAdapterSentinelTest extends AbstractRedisAdapterTestCase { public static function setUpBeforeClass(): void { diff --git a/Tests/Adapter/PredisAdapterTest.php b/Tests/Adapter/PredisAdapterTest.php index 28a2ca48..5fdd35ca 100644 --- a/Tests/Adapter/PredisAdapterTest.php +++ b/Tests/Adapter/PredisAdapterTest.php @@ -17,7 +17,7 @@ /** * @group integration */ -class PredisAdapterTest extends AbstractRedisAdapterTest +class PredisAdapterTest extends AbstractRedisAdapterTestCase { public static function setUpBeforeClass(): void { @@ -49,6 +49,31 @@ public function testCreateConnection() $this->assertSame($params, $connection->getParameters()->toArray()); } + public function testCreateSslConnection() + { + $redisHost = getenv('REDIS_HOST'); + + $redis = RedisAdapter::createConnection('rediss://'.$redisHost.'/1?ssl[verify_peer]=0', ['class' => \Predis\Client::class, 'timeout' => 3]); + $this->assertInstanceOf(\Predis\Client::class, $redis); + + $connection = $redis->getConnection(); + $this->assertInstanceOf(StreamConnection::class, $connection); + + $redisHost = explode(':', $redisHost); + $params = [ + 'scheme' => 'tls', + 'host' => $redisHost[0], + 'port' => (int) ($redisHost[1] ?? 6379), + 'ssl' => ['verify_peer' => '0'], + 'persistent' => 0, + 'timeout' => 3, + 'read_write_timeout' => 0, + 'tcp_nodelay' => true, + 'database' => '1', + ]; + $this->assertSame($params, $connection->getParameters()->toArray()); + } + public function testAclUserPasswordAuth() { // creating user via php-redis cause Predis (v1.1.10) does not support ACL command yet diff --git a/Tests/Adapter/PredisClusterAdapterTest.php b/Tests/Adapter/PredisClusterAdapterTest.php index 936c04aa..c64384bb 100644 --- a/Tests/Adapter/PredisClusterAdapterTest.php +++ b/Tests/Adapter/PredisClusterAdapterTest.php @@ -14,7 +14,7 @@ /** * @group integration */ -class PredisClusterAdapterTest extends AbstractRedisAdapterTest +class PredisClusterAdapterTest extends AbstractRedisAdapterTestCase { public static function setUpBeforeClass(): void { diff --git a/Tests/Adapter/PredisRedisClusterAdapterTest.php b/Tests/Adapter/PredisRedisClusterAdapterTest.php index 4367ce0b..3337272a 100644 --- a/Tests/Adapter/PredisRedisClusterAdapterTest.php +++ b/Tests/Adapter/PredisRedisClusterAdapterTest.php @@ -17,7 +17,7 @@ /** * @group integration */ -class PredisRedisClusterAdapterTest extends AbstractRedisAdapterTest +class PredisRedisClusterAdapterTest extends AbstractRedisAdapterTestCase { public static function setUpBeforeClass(): void { diff --git a/Tests/Adapter/ProxyAdapterAndRedisAdapterTest.php b/Tests/Adapter/ProxyAdapterAndRedisAdapterTest.php index 37282e8f..1f800e19 100644 --- a/Tests/Adapter/ProxyAdapterAndRedisAdapterTest.php +++ b/Tests/Adapter/ProxyAdapterAndRedisAdapterTest.php @@ -20,7 +20,7 @@ /** * @group integration */ -class ProxyAdapterAndRedisAdapterTest extends AbstractRedisAdapterTest +class ProxyAdapterAndRedisAdapterTest extends AbstractRedisAdapterTestCase { protected $skippedTests = [ 'testPrune' => 'RedisAdapter does not implement PruneableInterface.', diff --git a/Tests/Adapter/RedisAdapterSentinelTest.php b/Tests/Adapter/RedisAdapterSentinelTest.php index 521c5dc4..60171564 100644 --- a/Tests/Adapter/RedisAdapterSentinelTest.php +++ b/Tests/Adapter/RedisAdapterSentinelTest.php @@ -19,7 +19,7 @@ /** * @group integration */ -class RedisAdapterSentinelTest extends AbstractRedisAdapterTest +class RedisAdapterSentinelTest extends AbstractRedisAdapterTestCase { public static function setUpBeforeClass(): void { diff --git a/Tests/Adapter/RedisAdapterTest.php b/Tests/Adapter/RedisAdapterTest.php index 3caaa287..3b44d633 100644 --- a/Tests/Adapter/RedisAdapterTest.php +++ b/Tests/Adapter/RedisAdapterTest.php @@ -20,7 +20,7 @@ /** * @group integration */ -class RedisAdapterTest extends AbstractRedisAdapterTest +class RedisAdapterTest extends AbstractRedisAdapterTestCase { public static function setUpBeforeClass(): void { @@ -66,6 +66,9 @@ private function doTestCreateConnection(string $uri) $this->assertTrue($redis->isConnected()); $this->assertSame(0, $redis->getDbNum()); + $redis = RedisAdapter::createConnection('redis://'.$uri.'/'); + $this->assertSame(0, $redis->getDbNum()); + $redis = RedisAdapter::createConnection('redis://'.$uri.'/2'); $this->assertSame(2, $redis->getDbNum()); @@ -102,7 +105,7 @@ public function testFailedCreateConnection(string $dsn) RedisAdapter::createConnection($dsn); } - public function provideFailedCreateConnection(): array + public static function provideFailedCreateConnection(): array { return [ ['redis://localhost:1234'], @@ -122,7 +125,7 @@ public function testInvalidCreateConnection(string $dsn) RedisAdapter::createConnection($dsn); } - public function provideInvalidCreateConnection(): array + public static function provideInvalidCreateConnection(): array { return [ ['redis://localhost/foo'], diff --git a/Tests/Adapter/RedisArrayAdapterTest.php b/Tests/Adapter/RedisArrayAdapterTest.php index f9d481db..58ca3144 100644 --- a/Tests/Adapter/RedisArrayAdapterTest.php +++ b/Tests/Adapter/RedisArrayAdapterTest.php @@ -16,7 +16,7 @@ /** * @group integration */ -class RedisArrayAdapterTest extends AbstractRedisAdapterTest +class RedisArrayAdapterTest extends AbstractRedisAdapterTestCase { public static function setUpBeforeClass(): void { diff --git a/Tests/Adapter/RedisClusterAdapterTest.php b/Tests/Adapter/RedisClusterAdapterTest.php index fca50690..cdfa4f43 100644 --- a/Tests/Adapter/RedisClusterAdapterTest.php +++ b/Tests/Adapter/RedisClusterAdapterTest.php @@ -21,7 +21,7 @@ /** * @group integration */ -class RedisClusterAdapterTest extends AbstractRedisAdapterTest +class RedisClusterAdapterTest extends AbstractRedisAdapterTestCase { public static function setUpBeforeClass(): void { @@ -58,7 +58,7 @@ public function testFailedCreateConnection(string $dsn) RedisAdapter::createConnection($dsn); } - public function provideFailedCreateConnection(): array + public static function provideFailedCreateConnection(): array { return [ ['redis://localhost:1234?redis_cluster=1'], diff --git a/Tests/Adapter/TagAwareAndProxyAdapterIntegrationTest.php b/Tests/Adapter/TagAwareAndProxyAdapterIntegrationTest.php index bcb3c015..4af199dc 100644 --- a/Tests/Adapter/TagAwareAndProxyAdapterIntegrationTest.php +++ b/Tests/Adapter/TagAwareAndProxyAdapterIntegrationTest.php @@ -58,7 +58,7 @@ public function testIntegrationUsingProxiedAdapterForTagsPool() $this->assertFalse($cache->getItem('foo')->isHit()); } - public function dataProvider(): array + public static function dataProvider(): array { return [ [new ArrayAdapter()], diff --git a/Tests/CacheItemTest.php b/Tests/CacheItemTest.php index 12337f67..01358e96 100644 --- a/Tests/CacheItemTest.php +++ b/Tests/CacheItemTest.php @@ -34,7 +34,7 @@ public function testInvalidKey($key) CacheItem::validateKey($key); } - public function provideInvalidKey(): array + public static function provideInvalidKey(): array { return [ [''], diff --git a/Tests/Messenger/EarlyExpirationHandlerTest.php b/Tests/Messenger/EarlyExpirationHandlerTest.php index 7335ad4b..6b842545 100644 --- a/Tests/Messenger/EarlyExpirationHandlerTest.php +++ b/Tests/Messenger/EarlyExpirationHandlerTest.php @@ -12,14 +12,15 @@ namespace Symfony\Component\Cache\Tests\Messenger; use PHPUnit\Framework\TestCase; +use Psr\Cache\CacheItemInterface; use Symfony\Component\Cache\Adapter\FilesystemAdapter; -use Symfony\Component\Cache\CacheItem; use Symfony\Component\Cache\Messenger\EarlyExpirationHandler; use Symfony\Component\Cache\Messenger\EarlyExpirationMessage; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ReverseContainer; use Symfony\Component\DependencyInjection\ServiceLocator; use Symfony\Component\Filesystem\Filesystem; +use Symfony\Contracts\Cache\CallbackInterface; class EarlyExpirationHandlerTest extends TestCase { @@ -37,8 +38,8 @@ public function testHandle() $item = $pool->getItem('foo'); $item->set(234); - $computationService = new class() { - public function __invoke(CacheItem $item) + $computationService = new class() implements CallbackInterface { + public function __invoke(CacheItemInterface $item, bool &$save): mixed { usleep(30000); $item->expiresAfter(3600); diff --git a/Tests/Traits/RedisProxiesTest.php b/Tests/Traits/RedisProxiesTest.php index 27fabf70..b7711163 100644 --- a/Tests/Traits/RedisProxiesTest.php +++ b/Tests/Traits/RedisProxiesTest.php @@ -27,7 +27,7 @@ class RedisProxiesTest extends TestCase public function testRedis5Proxy($class) { $proxy = file_get_contents(\dirname(__DIR__, 2)."/Traits/{$class}5Proxy.php"); - $proxy = substr($proxy, 0, 8 + strpos($proxy, "\n ];")); + $proxy = substr($proxy, 0, 4 + strpos($proxy, '[];')); $methods = []; foreach ((new \ReflectionClass($class))->getMethods() as $method) { @@ -35,9 +35,9 @@ public function testRedis5Proxy($class) continue; } $return = $method->getReturnType() instanceof \ReflectionNamedType && 'void' === (string) $method->getReturnType() ? '' : 'return '; - $methods[] = "\n ".ProxyHelper::exportSignature($method, false)."\n".<<lazyObjectReal->{$method->name}(...\\func_get_args()); + {$return}(\$this->lazyObjectState->realInstance ??= (\$this->lazyObjectState->initializer)())->{$method->name}({$args}); } EOPHP; @@ -64,7 +64,7 @@ public function testRedis6Proxy($class, $stub) eval(substr($stub, 5)); $proxy = file_get_contents(\dirname(__DIR__, 2)."/Traits/{$class}6Proxy.php"); - $proxy = substr($proxy, 0, 8 + strpos($proxy, "\n ];")); + $proxy = substr($proxy, 0, 4 + strpos($proxy, '[];')); $methods = []; foreach ((new \ReflectionClass($class.'StubInterface'))->getMethods() as $method) { @@ -72,9 +72,9 @@ public function testRedis6Proxy($class, $stub) continue; } $return = $method->getReturnType() instanceof \ReflectionNamedType && 'void' === (string) $method->getReturnType() ? '' : 'return '; - $methods[] = "\n ".ProxyHelper::exportSignature($method, false)."\n".<<lazyObjectReal->{$method->name}(...\\func_get_args()); + {$return}(\$this->lazyObjectState->realInstance ??= (\$this->lazyObjectState->initializer)())->{$method->name}({$args}); } EOPHP; diff --git a/Traits/AbstractAdapterTrait.php b/Traits/AbstractAdapterTrait.php index 67ba1593..dfb94c25 100644 --- a/Traits/AbstractAdapterTrait.php +++ b/Traits/AbstractAdapterTrait.php @@ -255,7 +255,7 @@ public function saveDeferred(CacheItemInterface $item): bool * When versioning is enabled, clearing the cache is atomic and doesn't require listing existing keys to proceed, * but old keys may need garbage collection and extra round-trips to the back-end are required. * - * Calling this method also clears the memoized namespace version and thus forces a resynchonization of it. + * Calling this method also clears the memoized namespace version and thus forces a resynchronization of it. * * @return bool the previous state of versioning */ @@ -317,7 +317,10 @@ private function generateItems(iterable $items, array &$keys): \Generator } } - private function getId(mixed $key) + /** + * @internal + */ + protected function getId(mixed $key) { if ($this->versioningIsEnabled && '' === $this->namespaceVersion) { $this->ids = []; diff --git a/Traits/FilesystemTrait.php b/Traits/FilesystemTrait.php index b1464f0c..47e9b838 100644 --- a/Traits/FilesystemTrait.php +++ b/Traits/FilesystemTrait.php @@ -38,7 +38,7 @@ public function prune(): bool if (($expiresAt = (int) fgets($h)) && $time >= $expiresAt) { fclose($h); - $pruned = @unlink($file) && !file_exists($file) && $pruned; + $pruned = (@unlink($file) || !file_exists($file)) && $pruned; } else { fclose($h); } diff --git a/Traits/Redis5Proxy.php b/Traits/Redis5Proxy.php index bcfe8bc8..b835e553 100644 --- a/Traits/Redis5Proxy.php +++ b/Traits/Redis5Proxy.php @@ -29,1203 +29,1200 @@ class Redis5Proxy extends \Redis implements ResetInterface, LazyObjectInterface resetLazyObject as reset; } - private const LAZY_OBJECT_PROPERTY_SCOPES = [ - 'lazyObjectReal' => [self::class, 'lazyObjectReal', null], - "\0".self::class."\0lazyObjectReal" => [self::class, 'lazyObjectReal', null], - ]; + private const LAZY_OBJECT_PROPERTY_SCOPES = []; public function __construct() { - return $this->lazyObjectReal->__construct(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->__construct(...\func_get_args()); } public function _prefix($key) { - return $this->lazyObjectReal->_prefix(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_prefix(...\func_get_args()); } public function _serialize($value) { - return $this->lazyObjectReal->_serialize(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_serialize(...\func_get_args()); } public function _unserialize($value) { - return $this->lazyObjectReal->_unserialize(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_unserialize(...\func_get_args()); } public function _pack($value) { - return $this->lazyObjectReal->_pack(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_pack(...\func_get_args()); } public function _unpack($value) { - return $this->lazyObjectReal->_unpack(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_unpack(...\func_get_args()); } public function _compress($value) { - return $this->lazyObjectReal->_compress(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_compress(...\func_get_args()); } public function _uncompress($value) { - return $this->lazyObjectReal->_uncompress(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_uncompress(...\func_get_args()); } public function acl($subcmd, ...$args) { - return $this->lazyObjectReal->acl(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->acl(...\func_get_args()); } public function append($key, $value) { - return $this->lazyObjectReal->append(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->append(...\func_get_args()); } public function auth($auth) { - return $this->lazyObjectReal->auth(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->auth(...\func_get_args()); } public function bgSave() { - return $this->lazyObjectReal->bgSave(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bgSave(...\func_get_args()); } public function bgrewriteaof() { - return $this->lazyObjectReal->bgrewriteaof(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bgrewriteaof(...\func_get_args()); } public function bitcount($key) { - return $this->lazyObjectReal->bitcount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bitcount(...\func_get_args()); } public function bitop($operation, $ret_key, $key, ...$other_keys) { - return $this->lazyObjectReal->bitop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bitop(...\func_get_args()); } public function bitpos($key, $bit, $start = null, $end = null) { - return $this->lazyObjectReal->bitpos(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bitpos(...\func_get_args()); } public function blPop($key, $timeout_or_key, ...$extra_args) { - return $this->lazyObjectReal->blPop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->blPop(...\func_get_args()); } public function brPop($key, $timeout_or_key, ...$extra_args) { - return $this->lazyObjectReal->brPop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->brPop(...\func_get_args()); } public function brpoplpush($src, $dst, $timeout) { - return $this->lazyObjectReal->brpoplpush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->brpoplpush(...\func_get_args()); } public function bzPopMax($key, $timeout_or_key, ...$extra_args) { - return $this->lazyObjectReal->bzPopMax(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bzPopMax(...\func_get_args()); } public function bzPopMin($key, $timeout_or_key, ...$extra_args) { - return $this->lazyObjectReal->bzPopMin(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bzPopMin(...\func_get_args()); } public function clearLastError() { - return $this->lazyObjectReal->clearLastError(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->clearLastError(...\func_get_args()); } public function client($cmd, ...$args) { - return $this->lazyObjectReal->client(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->client(...\func_get_args()); } public function close() { - return $this->lazyObjectReal->close(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->close(...\func_get_args()); } public function command(...$args) { - return $this->lazyObjectReal->command(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->command(...\func_get_args()); } public function config($cmd, $key, $value = null) { - return $this->lazyObjectReal->config(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->config(...\func_get_args()); } public function connect($host, $port = null, $timeout = null, $retry_interval = null) { - return $this->lazyObjectReal->connect(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->connect(...\func_get_args()); } public function dbSize() { - return $this->lazyObjectReal->dbSize(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->dbSize(...\func_get_args()); } public function debug($key) { - return $this->lazyObjectReal->debug(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->debug(...\func_get_args()); } public function decr($key) { - return $this->lazyObjectReal->decr(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->decr(...\func_get_args()); } public function decrBy($key, $value) { - return $this->lazyObjectReal->decrBy(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->decrBy(...\func_get_args()); } public function del($key, ...$other_keys) { - return $this->lazyObjectReal->del(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->del(...\func_get_args()); } public function discard() { - return $this->lazyObjectReal->discard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->discard(...\func_get_args()); } public function dump($key) { - return $this->lazyObjectReal->dump(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->dump(...\func_get_args()); } public function echo($msg) { - return $this->lazyObjectReal->echo(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->echo(...\func_get_args()); } public function eval($script, $args = null, $num_keys = null) { - return $this->lazyObjectReal->eval(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->eval(...\func_get_args()); } public function evalsha($script_sha, $args = null, $num_keys = null) { - return $this->lazyObjectReal->evalsha(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->evalsha(...\func_get_args()); } public function exec() { - return $this->lazyObjectReal->exec(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->exec(...\func_get_args()); } public function exists($key, ...$other_keys) { - return $this->lazyObjectReal->exists(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->exists(...\func_get_args()); } public function expire($key, $timeout) { - return $this->lazyObjectReal->expire(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->expire(...\func_get_args()); } public function expireAt($key, $timestamp) { - return $this->lazyObjectReal->expireAt(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->expireAt(...\func_get_args()); } public function flushAll($async = null) { - return $this->lazyObjectReal->flushAll(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->flushAll(...\func_get_args()); } public function flushDB($async = null) { - return $this->lazyObjectReal->flushDB(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->flushDB(...\func_get_args()); } public function geoadd($key, $lng, $lat, $member, ...$other_triples) { - return $this->lazyObjectReal->geoadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geoadd(...\func_get_args()); } public function geodist($key, $src, $dst, $unit = null) { - return $this->lazyObjectReal->geodist(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geodist(...\func_get_args()); } public function geohash($key, $member, ...$other_members) { - return $this->lazyObjectReal->geohash(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geohash(...\func_get_args()); } public function geopos($key, $member, ...$other_members) { - return $this->lazyObjectReal->geopos(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geopos(...\func_get_args()); } public function georadius($key, $lng, $lan, $radius, $unit, $opts = null) { - return $this->lazyObjectReal->georadius(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadius(...\func_get_args()); } public function georadius_ro($key, $lng, $lan, $radius, $unit, $opts = null) { - return $this->lazyObjectReal->georadius_ro(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadius_ro(...\func_get_args()); } public function georadiusbymember($key, $member, $radius, $unit, $opts = null) { - return $this->lazyObjectReal->georadiusbymember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadiusbymember(...\func_get_args()); } public function georadiusbymember_ro($key, $member, $radius, $unit, $opts = null) { - return $this->lazyObjectReal->georadiusbymember_ro(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadiusbymember_ro(...\func_get_args()); } public function get($key) { - return $this->lazyObjectReal->get(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->get(...\func_get_args()); } public function getAuth() { - return $this->lazyObjectReal->getAuth(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getAuth(...\func_get_args()); } public function getBit($key, $offset) { - return $this->lazyObjectReal->getBit(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getBit(...\func_get_args()); } public function getDBNum() { - return $this->lazyObjectReal->getDBNum(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getDBNum(...\func_get_args()); } public function getHost() { - return $this->lazyObjectReal->getHost(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getHost(...\func_get_args()); } public function getLastError() { - return $this->lazyObjectReal->getLastError(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getLastError(...\func_get_args()); } public function getMode() { - return $this->lazyObjectReal->getMode(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getMode(...\func_get_args()); } public function getOption($option) { - return $this->lazyObjectReal->getOption(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getOption(...\func_get_args()); } public function getPersistentID() { - return $this->lazyObjectReal->getPersistentID(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getPersistentID(...\func_get_args()); } public function getPort() { - return $this->lazyObjectReal->getPort(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getPort(...\func_get_args()); } public function getRange($key, $start, $end) { - return $this->lazyObjectReal->getRange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getRange(...\func_get_args()); } public function getReadTimeout() { - return $this->lazyObjectReal->getReadTimeout(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getReadTimeout(...\func_get_args()); } public function getSet($key, $value) { - return $this->lazyObjectReal->getSet(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getSet(...\func_get_args()); } public function getTimeout() { - return $this->lazyObjectReal->getTimeout(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getTimeout(...\func_get_args()); } public function hDel($key, $member, ...$other_members) { - return $this->lazyObjectReal->hDel(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hDel(...\func_get_args()); } public function hExists($key, $member) { - return $this->lazyObjectReal->hExists(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hExists(...\func_get_args()); } public function hGet($key, $member) { - return $this->lazyObjectReal->hGet(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hGet(...\func_get_args()); } public function hGetAll($key) { - return $this->lazyObjectReal->hGetAll(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hGetAll(...\func_get_args()); } public function hIncrBy($key, $member, $value) { - return $this->lazyObjectReal->hIncrBy(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hIncrBy(...\func_get_args()); } public function hIncrByFloat($key, $member, $value) { - return $this->lazyObjectReal->hIncrByFloat(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hIncrByFloat(...\func_get_args()); } public function hKeys($key) { - return $this->lazyObjectReal->hKeys(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hKeys(...\func_get_args()); } public function hLen($key) { - return $this->lazyObjectReal->hLen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hLen(...\func_get_args()); } public function hMget($key, $keys) { - return $this->lazyObjectReal->hMget(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hMget(...\func_get_args()); } public function hMset($key, $pairs) { - return $this->lazyObjectReal->hMset(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hMset(...\func_get_args()); } public function hSet($key, $member, $value) { - return $this->lazyObjectReal->hSet(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hSet(...\func_get_args()); } public function hSetNx($key, $member, $value) { - return $this->lazyObjectReal->hSetNx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hSetNx(...\func_get_args()); } public function hStrLen($key, $member) { - return $this->lazyObjectReal->hStrLen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hStrLen(...\func_get_args()); } public function hVals($key) { - return $this->lazyObjectReal->hVals(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hVals(...\func_get_args()); } public function hscan($str_key, &$i_iterator, $str_pattern = null, $i_count = null) { - return $this->lazyObjectReal->hscan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hscan($str_key, $i_iterator, $str_pattern, $i_count, ...\array_slice(\func_get_args(), 4)); } public function incr($key) { - return $this->lazyObjectReal->incr(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->incr(...\func_get_args()); } public function incrBy($key, $value) { - return $this->lazyObjectReal->incrBy(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->incrBy(...\func_get_args()); } public function incrByFloat($key, $value) { - return $this->lazyObjectReal->incrByFloat(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->incrByFloat(...\func_get_args()); } public function info($option = null) { - return $this->lazyObjectReal->info(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->info(...\func_get_args()); } public function isConnected() { - return $this->lazyObjectReal->isConnected(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->isConnected(...\func_get_args()); } public function keys($pattern) { - return $this->lazyObjectReal->keys(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->keys(...\func_get_args()); } public function lInsert($key, $position, $pivot, $value) { - return $this->lazyObjectReal->lInsert(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lInsert(...\func_get_args()); } public function lLen($key) { - return $this->lazyObjectReal->lLen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lLen(...\func_get_args()); } public function lPop($key) { - return $this->lazyObjectReal->lPop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lPop(...\func_get_args()); } public function lPush($key, $value) { - return $this->lazyObjectReal->lPush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lPush(...\func_get_args()); } public function lPushx($key, $value) { - return $this->lazyObjectReal->lPushx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lPushx(...\func_get_args()); } public function lSet($key, $index, $value) { - return $this->lazyObjectReal->lSet(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lSet(...\func_get_args()); } public function lastSave() { - return $this->lazyObjectReal->lastSave(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lastSave(...\func_get_args()); } public function lindex($key, $index) { - return $this->lazyObjectReal->lindex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lindex(...\func_get_args()); } public function lrange($key, $start, $end) { - return $this->lazyObjectReal->lrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lrange(...\func_get_args()); } public function lrem($key, $value, $count) { - return $this->lazyObjectReal->lrem(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lrem(...\func_get_args()); } public function ltrim($key, $start, $stop) { - return $this->lazyObjectReal->ltrim(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->ltrim(...\func_get_args()); } public function mget($keys) { - return $this->lazyObjectReal->mget(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->mget(...\func_get_args()); } public function migrate($host, $port, $key, $db, $timeout, $copy = null, $replace = null) { - return $this->lazyObjectReal->migrate(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->migrate(...\func_get_args()); } public function move($key, $dbindex) { - return $this->lazyObjectReal->move(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->move(...\func_get_args()); } public function mset($pairs) { - return $this->lazyObjectReal->mset(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->mset(...\func_get_args()); } public function msetnx($pairs) { - return $this->lazyObjectReal->msetnx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->msetnx(...\func_get_args()); } public function multi($mode = null) { - return $this->lazyObjectReal->multi(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->multi(...\func_get_args()); } public function object($field, $key) { - return $this->lazyObjectReal->object(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->object(...\func_get_args()); } public function pconnect($host, $port = null, $timeout = null) { - return $this->lazyObjectReal->pconnect(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pconnect(...\func_get_args()); } public function persist($key) { - return $this->lazyObjectReal->persist(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->persist(...\func_get_args()); } public function pexpire($key, $timestamp) { - return $this->lazyObjectReal->pexpire(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pexpire(...\func_get_args()); } public function pexpireAt($key, $timestamp) { - return $this->lazyObjectReal->pexpireAt(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pexpireAt(...\func_get_args()); } public function pfadd($key, $elements) { - return $this->lazyObjectReal->pfadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pfadd(...\func_get_args()); } public function pfcount($key) { - return $this->lazyObjectReal->pfcount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pfcount(...\func_get_args()); } public function pfmerge($dstkey, $keys) { - return $this->lazyObjectReal->pfmerge(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pfmerge(...\func_get_args()); } public function ping() { - return $this->lazyObjectReal->ping(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->ping(...\func_get_args()); } public function pipeline() { - return $this->lazyObjectReal->pipeline(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pipeline(...\func_get_args()); } public function psetex($key, $expire, $value) { - return $this->lazyObjectReal->psetex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->psetex(...\func_get_args()); } public function psubscribe($patterns, $callback) { - return $this->lazyObjectReal->psubscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->psubscribe(...\func_get_args()); } public function pttl($key) { - return $this->lazyObjectReal->pttl(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pttl(...\func_get_args()); } public function publish($channel, $message) { - return $this->lazyObjectReal->publish(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->publish(...\func_get_args()); } public function pubsub($cmd, ...$args) { - return $this->lazyObjectReal->pubsub(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pubsub(...\func_get_args()); } public function punsubscribe($pattern, ...$other_patterns) { - return $this->lazyObjectReal->punsubscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->punsubscribe(...\func_get_args()); } public function rPop($key) { - return $this->lazyObjectReal->rPop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rPop(...\func_get_args()); } public function rPush($key, $value) { - return $this->lazyObjectReal->rPush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rPush(...\func_get_args()); } public function rPushx($key, $value) { - return $this->lazyObjectReal->rPushx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rPushx(...\func_get_args()); } public function randomKey() { - return $this->lazyObjectReal->randomKey(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->randomKey(...\func_get_args()); } public function rawcommand($cmd, ...$args) { - return $this->lazyObjectReal->rawcommand(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rawcommand(...\func_get_args()); } public function rename($key, $newkey) { - return $this->lazyObjectReal->rename(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rename(...\func_get_args()); } public function renameNx($key, $newkey) { - return $this->lazyObjectReal->renameNx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->renameNx(...\func_get_args()); } public function restore($ttl, $key, $value) { - return $this->lazyObjectReal->restore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->restore(...\func_get_args()); } public function role() { - return $this->lazyObjectReal->role(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->role(...\func_get_args()); } public function rpoplpush($src, $dst) { - return $this->lazyObjectReal->rpoplpush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rpoplpush(...\func_get_args()); } public function sAdd($key, $value) { - return $this->lazyObjectReal->sAdd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sAdd(...\func_get_args()); } public function sAddArray($key, $options) { - return $this->lazyObjectReal->sAddArray(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sAddArray(...\func_get_args()); } public function sDiff($key, ...$other_keys) { - return $this->lazyObjectReal->sDiff(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sDiff(...\func_get_args()); } public function sDiffStore($dst, $key, ...$other_keys) { - return $this->lazyObjectReal->sDiffStore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sDiffStore(...\func_get_args()); } public function sInter($key, ...$other_keys) { - return $this->lazyObjectReal->sInter(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sInter(...\func_get_args()); } public function sInterStore($dst, $key, ...$other_keys) { - return $this->lazyObjectReal->sInterStore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sInterStore(...\func_get_args()); } public function sMembers($key) { - return $this->lazyObjectReal->sMembers(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sMembers(...\func_get_args()); } public function sMisMember($key, $member, ...$other_members) { - return $this->lazyObjectReal->sMisMember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sMisMember(...\func_get_args()); } public function sMove($src, $dst, $value) { - return $this->lazyObjectReal->sMove(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sMove(...\func_get_args()); } public function sPop($key) { - return $this->lazyObjectReal->sPop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sPop(...\func_get_args()); } public function sRandMember($key, $count = null) { - return $this->lazyObjectReal->sRandMember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sRandMember(...\func_get_args()); } public function sUnion($key, ...$other_keys) { - return $this->lazyObjectReal->sUnion(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sUnion(...\func_get_args()); } public function sUnionStore($dst, $key, ...$other_keys) { - return $this->lazyObjectReal->sUnionStore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sUnionStore(...\func_get_args()); } public function save() { - return $this->lazyObjectReal->save(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->save(...\func_get_args()); } public function scan(&$i_iterator, $str_pattern = null, $i_count = null) { - return $this->lazyObjectReal->scan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->scan($i_iterator, $str_pattern, $i_count, ...\array_slice(\func_get_args(), 3)); } public function scard($key) { - return $this->lazyObjectReal->scard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->scard(...\func_get_args()); } public function script($cmd, ...$args) { - return $this->lazyObjectReal->script(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->script(...\func_get_args()); } public function select($dbindex) { - return $this->lazyObjectReal->select(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->select(...\func_get_args()); } public function set($key, $value, $opts = null) { - return $this->lazyObjectReal->set(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->set(...\func_get_args()); } public function setBit($key, $offset, $value) { - return $this->lazyObjectReal->setBit(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setBit(...\func_get_args()); } public function setOption($option, $value) { - return $this->lazyObjectReal->setOption(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setOption(...\func_get_args()); } public function setRange($key, $offset, $value) { - return $this->lazyObjectReal->setRange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setRange(...\func_get_args()); } public function setex($key, $expire, $value) { - return $this->lazyObjectReal->setex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setex(...\func_get_args()); } public function setnx($key, $value) { - return $this->lazyObjectReal->setnx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setnx(...\func_get_args()); } public function sismember($key, $value) { - return $this->lazyObjectReal->sismember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sismember(...\func_get_args()); } public function slaveof($host = null, $port = null) { - return $this->lazyObjectReal->slaveof(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->slaveof(...\func_get_args()); } public function slowlog($arg, $option = null) { - return $this->lazyObjectReal->slowlog(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->slowlog(...\func_get_args()); } public function sort($key, $options = null) { - return $this->lazyObjectReal->sort(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sort(...\func_get_args()); } public function sortAsc($key, $pattern = null, $get = null, $start = null, $end = null, $getList = null) { - return $this->lazyObjectReal->sortAsc(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sortAsc(...\func_get_args()); } public function sortAscAlpha($key, $pattern = null, $get = null, $start = null, $end = null, $getList = null) { - return $this->lazyObjectReal->sortAscAlpha(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sortAscAlpha(...\func_get_args()); } public function sortDesc($key, $pattern = null, $get = null, $start = null, $end = null, $getList = null) { - return $this->lazyObjectReal->sortDesc(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sortDesc(...\func_get_args()); } public function sortDescAlpha($key, $pattern = null, $get = null, $start = null, $end = null, $getList = null) { - return $this->lazyObjectReal->sortDescAlpha(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sortDescAlpha(...\func_get_args()); } public function srem($key, $member, ...$other_members) { - return $this->lazyObjectReal->srem(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->srem(...\func_get_args()); } public function sscan($str_key, &$i_iterator, $str_pattern = null, $i_count = null) { - return $this->lazyObjectReal->sscan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sscan($str_key, $i_iterator, $str_pattern, $i_count, ...\array_slice(\func_get_args(), 4)); } public function strlen($key) { - return $this->lazyObjectReal->strlen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->strlen(...\func_get_args()); } public function subscribe($channels, $callback) { - return $this->lazyObjectReal->subscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->subscribe(...\func_get_args()); } public function swapdb($srcdb, $dstdb) { - return $this->lazyObjectReal->swapdb(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->swapdb(...\func_get_args()); } public function time() { - return $this->lazyObjectReal->time(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->time(...\func_get_args()); } public function ttl($key) { - return $this->lazyObjectReal->ttl(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->ttl(...\func_get_args()); } public function type($key) { - return $this->lazyObjectReal->type(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->type(...\func_get_args()); } public function unlink($key, ...$other_keys) { - return $this->lazyObjectReal->unlink(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->unlink(...\func_get_args()); } public function unsubscribe($channel, ...$other_channels) { - return $this->lazyObjectReal->unsubscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->unsubscribe(...\func_get_args()); } public function unwatch() { - return $this->lazyObjectReal->unwatch(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->unwatch(...\func_get_args()); } public function wait($numslaves, $timeout) { - return $this->lazyObjectReal->wait(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->wait(...\func_get_args()); } public function watch($key, ...$other_keys) { - return $this->lazyObjectReal->watch(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->watch(...\func_get_args()); } public function xack($str_key, $str_group, $arr_ids) { - return $this->lazyObjectReal->xack(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xack(...\func_get_args()); } public function xadd($str_key, $str_id, $arr_fields, $i_maxlen = null, $boo_approximate = null) { - return $this->lazyObjectReal->xadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xadd(...\func_get_args()); } public function xclaim($str_key, $str_group, $str_consumer, $i_min_idle, $arr_ids, $arr_opts = null) { - return $this->lazyObjectReal->xclaim(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xclaim(...\func_get_args()); } public function xdel($str_key, $arr_ids) { - return $this->lazyObjectReal->xdel(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xdel(...\func_get_args()); } public function xgroup($str_operation, $str_key = null, $str_arg1 = null, $str_arg2 = null, $str_arg3 = null) { - return $this->lazyObjectReal->xgroup(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xgroup(...\func_get_args()); } public function xinfo($str_cmd, $str_key = null, $str_group = null) { - return $this->lazyObjectReal->xinfo(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xinfo(...\func_get_args()); } public function xlen($key) { - return $this->lazyObjectReal->xlen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xlen(...\func_get_args()); } public function xpending($str_key, $str_group, $str_start = null, $str_end = null, $i_count = null, $str_consumer = null) { - return $this->lazyObjectReal->xpending(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xpending(...\func_get_args()); } public function xrange($str_key, $str_start, $str_end, $i_count = null) { - return $this->lazyObjectReal->xrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xrange(...\func_get_args()); } public function xread($arr_streams, $i_count = null, $i_block = null) { - return $this->lazyObjectReal->xread(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xread(...\func_get_args()); } public function xreadgroup($str_group, $str_consumer, $arr_streams, $i_count = null, $i_block = null) { - return $this->lazyObjectReal->xreadgroup(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xreadgroup(...\func_get_args()); } public function xrevrange($str_key, $str_start, $str_end, $i_count = null) { - return $this->lazyObjectReal->xrevrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xrevrange(...\func_get_args()); } public function xtrim($str_key, $i_maxlen, $boo_approximate = null) { - return $this->lazyObjectReal->xtrim(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xtrim(...\func_get_args()); } public function zAdd($key, $score, $value, ...$extra_args) { - return $this->lazyObjectReal->zAdd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zAdd(...\func_get_args()); } public function zCard($key) { - return $this->lazyObjectReal->zCard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zCard(...\func_get_args()); } public function zCount($key, $min, $max) { - return $this->lazyObjectReal->zCount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zCount(...\func_get_args()); } public function zIncrBy($key, $value, $member) { - return $this->lazyObjectReal->zIncrBy(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zIncrBy(...\func_get_args()); } public function zLexCount($key, $min, $max) { - return $this->lazyObjectReal->zLexCount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zLexCount(...\func_get_args()); } public function zPopMax($key) { - return $this->lazyObjectReal->zPopMax(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zPopMax(...\func_get_args()); } public function zPopMin($key) { - return $this->lazyObjectReal->zPopMin(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zPopMin(...\func_get_args()); } public function zRange($key, $start, $end, $scores = null) { - return $this->lazyObjectReal->zRange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRange(...\func_get_args()); } public function zRangeByLex($key, $min, $max, $offset = null, $limit = null) { - return $this->lazyObjectReal->zRangeByLex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRangeByLex(...\func_get_args()); } public function zRangeByScore($key, $start, $end, $options = null) { - return $this->lazyObjectReal->zRangeByScore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRangeByScore(...\func_get_args()); } public function zRank($key, $member) { - return $this->lazyObjectReal->zRank(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRank(...\func_get_args()); } public function zRem($key, $member, ...$other_members) { - return $this->lazyObjectReal->zRem(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRem(...\func_get_args()); } public function zRemRangeByLex($key, $min, $max) { - return $this->lazyObjectReal->zRemRangeByLex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRemRangeByLex(...\func_get_args()); } public function zRemRangeByRank($key, $start, $end) { - return $this->lazyObjectReal->zRemRangeByRank(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRemRangeByRank(...\func_get_args()); } public function zRemRangeByScore($key, $min, $max) { - return $this->lazyObjectReal->zRemRangeByScore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRemRangeByScore(...\func_get_args()); } public function zRevRange($key, $start, $end, $scores = null) { - return $this->lazyObjectReal->zRevRange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRevRange(...\func_get_args()); } public function zRevRangeByLex($key, $min, $max, $offset = null, $limit = null) { - return $this->lazyObjectReal->zRevRangeByLex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRevRangeByLex(...\func_get_args()); } public function zRevRangeByScore($key, $start, $end, $options = null) { - return $this->lazyObjectReal->zRevRangeByScore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRevRangeByScore(...\func_get_args()); } public function zRevRank($key, $member) { - return $this->lazyObjectReal->zRevRank(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRevRank(...\func_get_args()); } public function zScore($key, $member) { - return $this->lazyObjectReal->zScore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zScore(...\func_get_args()); } public function zinterstore($key, $keys, $weights = null, $aggregate = null) { - return $this->lazyObjectReal->zinterstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zinterstore(...\func_get_args()); } public function zscan($str_key, &$i_iterator, $str_pattern = null, $i_count = null) { - return $this->lazyObjectReal->zscan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zscan($str_key, $i_iterator, $str_pattern, $i_count, ...\array_slice(\func_get_args(), 4)); } public function zunionstore($key, $keys, $weights = null, $aggregate = null) { - return $this->lazyObjectReal->zunionstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zunionstore(...\func_get_args()); } public function delete($key, ...$other_keys) { - return $this->lazyObjectReal->delete(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->delete(...\func_get_args()); } public function evaluate($script, $args = null, $num_keys = null) { - return $this->lazyObjectReal->evaluate(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->evaluate(...\func_get_args()); } public function evaluateSha($script_sha, $args = null, $num_keys = null) { - return $this->lazyObjectReal->evaluateSha(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->evaluateSha(...\func_get_args()); } public function getKeys($pattern) { - return $this->lazyObjectReal->getKeys(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getKeys(...\func_get_args()); } public function getMultiple($keys) { - return $this->lazyObjectReal->getMultiple(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getMultiple(...\func_get_args()); } public function lGet($key, $index) { - return $this->lazyObjectReal->lGet(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lGet(...\func_get_args()); } public function lGetRange($key, $start, $end) { - return $this->lazyObjectReal->lGetRange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lGetRange(...\func_get_args()); } public function lRemove($key, $value, $count) { - return $this->lazyObjectReal->lRemove(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lRemove(...\func_get_args()); } public function lSize($key) { - return $this->lazyObjectReal->lSize(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lSize(...\func_get_args()); } public function listTrim($key, $start, $stop) { - return $this->lazyObjectReal->listTrim(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->listTrim(...\func_get_args()); } public function open($host, $port = null, $timeout = null, $retry_interval = null) { - return $this->lazyObjectReal->open(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->open(...\func_get_args()); } public function popen($host, $port = null, $timeout = null) { - return $this->lazyObjectReal->popen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->popen(...\func_get_args()); } public function renameKey($key, $newkey) { - return $this->lazyObjectReal->renameKey(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->renameKey(...\func_get_args()); } public function sContains($key, $value) { - return $this->lazyObjectReal->sContains(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sContains(...\func_get_args()); } public function sGetMembers($key) { - return $this->lazyObjectReal->sGetMembers(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sGetMembers(...\func_get_args()); } public function sRemove($key, $member, ...$other_members) { - return $this->lazyObjectReal->sRemove(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sRemove(...\func_get_args()); } public function sSize($key) { - return $this->lazyObjectReal->sSize(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sSize(...\func_get_args()); } public function sendEcho($msg) { - return $this->lazyObjectReal->sendEcho(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sendEcho(...\func_get_args()); } public function setTimeout($key, $timeout) { - return $this->lazyObjectReal->setTimeout(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setTimeout(...\func_get_args()); } public function substr($key, $start, $end) { - return $this->lazyObjectReal->substr(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->substr(...\func_get_args()); } public function zDelete($key, $member, ...$other_members) { - return $this->lazyObjectReal->zDelete(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zDelete(...\func_get_args()); } public function zDeleteRangeByRank($key, $min, $max) { - return $this->lazyObjectReal->zDeleteRangeByRank(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zDeleteRangeByRank(...\func_get_args()); } public function zDeleteRangeByScore($key, $min, $max) { - return $this->lazyObjectReal->zDeleteRangeByScore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zDeleteRangeByScore(...\func_get_args()); } public function zInter($key, $keys, $weights = null, $aggregate = null) { - return $this->lazyObjectReal->zInter(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zInter(...\func_get_args()); } public function zRemove($key, $member, ...$other_members) { - return $this->lazyObjectReal->zRemove(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRemove(...\func_get_args()); } public function zRemoveRangeByScore($key, $min, $max) { - return $this->lazyObjectReal->zRemoveRangeByScore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRemoveRangeByScore(...\func_get_args()); } public function zReverseRange($key, $start, $end, $scores = null) { - return $this->lazyObjectReal->zReverseRange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zReverseRange(...\func_get_args()); } public function zSize($key) { - return $this->lazyObjectReal->zSize(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zSize(...\func_get_args()); } public function zUnion($key, $keys, $weights = null, $aggregate = null) { - return $this->lazyObjectReal->zUnion(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zUnion(...\func_get_args()); } } diff --git a/Traits/Redis6Proxy.php b/Traits/Redis6Proxy.php index 8d9ac740..0ede9afb 100644 --- a/Traits/Redis6Proxy.php +++ b/Traits/Redis6Proxy.php @@ -29,1253 +29,1265 @@ class Redis6Proxy extends \Redis implements ResetInterface, LazyObjectInterface resetLazyObject as reset; } - private const LAZY_OBJECT_PROPERTY_SCOPES = [ - 'lazyObjectReal' => [self::class, 'lazyObjectReal', null], - "\0".self::class."\0lazyObjectReal" => [self::class, 'lazyObjectReal', null], - ]; + private const LAZY_OBJECT_PROPERTY_SCOPES = []; public function __construct($options = null) { - return $this->lazyObjectReal->__construct(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->__construct(...\func_get_args()); } public function _compress($value): string { - return $this->lazyObjectReal->_compress(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_compress(...\func_get_args()); } public function _uncompress($value): string { - return $this->lazyObjectReal->_uncompress(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_uncompress(...\func_get_args()); } public function _prefix($key): string { - return $this->lazyObjectReal->_prefix(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_prefix(...\func_get_args()); } public function _serialize($value): string { - return $this->lazyObjectReal->_serialize(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_serialize(...\func_get_args()); } public function _unserialize($value): mixed { - return $this->lazyObjectReal->_unserialize(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_unserialize(...\func_get_args()); } public function _pack($value): string { - return $this->lazyObjectReal->_pack(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_pack(...\func_get_args()); } public function _unpack($value): mixed { - return $this->lazyObjectReal->_unpack(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_unpack(...\func_get_args()); } public function acl($subcmd, ...$args): mixed { - return $this->lazyObjectReal->acl(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->acl(...\func_get_args()); } public function append($key, $value): \Redis|false|int { - return $this->lazyObjectReal->append(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->append(...\func_get_args()); } public function auth(#[\SensitiveParameter] $credentials): \Redis|bool { - return $this->lazyObjectReal->auth(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->auth(...\func_get_args()); } public function bgSave(): \Redis|bool { - return $this->lazyObjectReal->bgSave(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bgSave(...\func_get_args()); } public function bgrewriteaof(): \Redis|bool { - return $this->lazyObjectReal->bgrewriteaof(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bgrewriteaof(...\func_get_args()); } public function bitcount($key, $start = 0, $end = -1, $bybit = false): \Redis|false|int { - return $this->lazyObjectReal->bitcount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bitcount(...\func_get_args()); } public function bitop($operation, $deskey, $srckey, ...$other_keys): \Redis|false|int { - return $this->lazyObjectReal->bitop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bitop(...\func_get_args()); } public function bitpos($key, $bit, $start = 0, $end = -1, $bybit = false): \Redis|false|int { - return $this->lazyObjectReal->bitpos(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bitpos(...\func_get_args()); } public function blPop($key_or_keys, $timeout_or_key, ...$extra_args): \Redis|array|false|null { - return $this->lazyObjectReal->blPop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->blPop(...\func_get_args()); } public function brPop($key_or_keys, $timeout_or_key, ...$extra_args): \Redis|array|false|null { - return $this->lazyObjectReal->brPop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->brPop(...\func_get_args()); } public function brpoplpush($src, $dst, $timeout): \Redis|false|string { - return $this->lazyObjectReal->brpoplpush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->brpoplpush(...\func_get_args()); } public function bzPopMax($key, $timeout_or_key, ...$extra_args): \Redis|array|false { - return $this->lazyObjectReal->bzPopMax(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bzPopMax(...\func_get_args()); } public function bzPopMin($key, $timeout_or_key, ...$extra_args): \Redis|array|false { - return $this->lazyObjectReal->bzPopMin(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bzPopMin(...\func_get_args()); } public function bzmpop($timeout, $keys, $from, $count = 1): \Redis|array|false|null { - return $this->lazyObjectReal->bzmpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bzmpop(...\func_get_args()); } public function zmpop($keys, $from, $count = 1): \Redis|array|false|null { - return $this->lazyObjectReal->zmpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zmpop(...\func_get_args()); } public function blmpop($timeout, $keys, $from, $count = 1): \Redis|array|false|null { - return $this->lazyObjectReal->blmpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->blmpop(...\func_get_args()); } public function lmpop($keys, $from, $count = 1): \Redis|array|false|null { - return $this->lazyObjectReal->lmpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lmpop(...\func_get_args()); } public function clearLastError(): bool { - return $this->lazyObjectReal->clearLastError(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->clearLastError(...\func_get_args()); } public function client($opt, ...$args): mixed { - return $this->lazyObjectReal->client(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->client(...\func_get_args()); } public function close(): bool { - return $this->lazyObjectReal->close(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->close(...\func_get_args()); } public function command($opt = null, ...$args): mixed { - return $this->lazyObjectReal->command(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->command(...\func_get_args()); } public function config($operation, $key_or_settings = null, $value = null): mixed { - return $this->lazyObjectReal->config(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->config(...\func_get_args()); } public function connect($host, $port = 6379, $timeout = 0.0, $persistent_id = null, $retry_interval = 0, $read_timeout = 0.0, $context = null): bool { - return $this->lazyObjectReal->connect(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->connect(...\func_get_args()); } public function copy($src, $dst, $options = null): \Redis|bool { - return $this->lazyObjectReal->copy(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->copy(...\func_get_args()); } public function dbSize(): \Redis|false|int { - return $this->lazyObjectReal->dbSize(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->dbSize(...\func_get_args()); } public function debug($key): \Redis|string { - return $this->lazyObjectReal->debug(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->debug(...\func_get_args()); } public function decr($key, $by = 1): \Redis|false|int { - return $this->lazyObjectReal->decr(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->decr(...\func_get_args()); } public function decrBy($key, $value): \Redis|false|int { - return $this->lazyObjectReal->decrBy(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->decrBy(...\func_get_args()); } public function del($key, ...$other_keys): \Redis|false|int { - return $this->lazyObjectReal->del(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->del(...\func_get_args()); } public function delete($key, ...$other_keys): \Redis|false|int { - return $this->lazyObjectReal->delete(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->delete(...\func_get_args()); } public function discard(): \Redis|bool { - return $this->lazyObjectReal->discard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->discard(...\func_get_args()); } public function dump($key): \Redis|string { - return $this->lazyObjectReal->dump(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->dump(...\func_get_args()); } public function echo($str): \Redis|false|string { - return $this->lazyObjectReal->echo(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->echo(...\func_get_args()); } public function eval($script, $args = [], $num_keys = 0): mixed { - return $this->lazyObjectReal->eval(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->eval(...\func_get_args()); } public function eval_ro($script_sha, $args = [], $num_keys = 0): mixed { - return $this->lazyObjectReal->eval_ro(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->eval_ro(...\func_get_args()); } public function evalsha($sha1, $args = [], $num_keys = 0): mixed { - return $this->lazyObjectReal->evalsha(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->evalsha(...\func_get_args()); } public function evalsha_ro($sha1, $args = [], $num_keys = 0): mixed { - return $this->lazyObjectReal->evalsha_ro(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->evalsha_ro(...\func_get_args()); } public function exec(): \Redis|array|false { - return $this->lazyObjectReal->exec(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->exec(...\func_get_args()); } public function exists($key, ...$other_keys): \Redis|bool|int { - return $this->lazyObjectReal->exists(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->exists(...\func_get_args()); } public function expire($key, $timeout, $mode = null): \Redis|bool { - return $this->lazyObjectReal->expire(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->expire(...\func_get_args()); } public function expireAt($key, $timestamp, $mode = null): \Redis|bool { - return $this->lazyObjectReal->expireAt(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->expireAt(...\func_get_args()); } public function failover($to = null, $abort = false, $timeout = 0): \Redis|bool { - return $this->lazyObjectReal->failover(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->failover(...\func_get_args()); } public function expiretime($key): \Redis|false|int { - return $this->lazyObjectReal->expiretime(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->expiretime(...\func_get_args()); } public function pexpiretime($key): \Redis|false|int { - return $this->lazyObjectReal->pexpiretime(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pexpiretime(...\func_get_args()); + } + + public function fcall($fn, $keys = [], $args = []): mixed + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->fcall(...\func_get_args()); + } + + public function fcall_ro($fn, $keys = [], $args = []): mixed + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->fcall_ro(...\func_get_args()); } public function flushAll($sync = null): \Redis|bool { - return $this->lazyObjectReal->flushAll(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->flushAll(...\func_get_args()); } public function flushDB($sync = null): \Redis|bool { - return $this->lazyObjectReal->flushDB(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->flushDB(...\func_get_args()); + } + + public function function($operation, ...$args): \Redis|array|bool|string + { + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->function(...\func_get_args()); } public function geoadd($key, $lng, $lat, $member, ...$other_triples_and_options): \Redis|false|int { - return $this->lazyObjectReal->geoadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geoadd(...\func_get_args()); } public function geodist($key, $src, $dst, $unit = null): \Redis|false|float { - return $this->lazyObjectReal->geodist(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geodist(...\func_get_args()); } public function geohash($key, $member, ...$other_members): \Redis|array|false { - return $this->lazyObjectReal->geohash(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geohash(...\func_get_args()); } public function geopos($key, $member, ...$other_members): \Redis|array|false { - return $this->lazyObjectReal->geopos(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geopos(...\func_get_args()); } public function georadius($key, $lng, $lat, $radius, $unit, $options = []): mixed { - return $this->lazyObjectReal->georadius(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadius(...\func_get_args()); } public function georadius_ro($key, $lng, $lat, $radius, $unit, $options = []): mixed { - return $this->lazyObjectReal->georadius_ro(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadius_ro(...\func_get_args()); } public function georadiusbymember($key, $member, $radius, $unit, $options = []): mixed { - return $this->lazyObjectReal->georadiusbymember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadiusbymember(...\func_get_args()); } public function georadiusbymember_ro($key, $member, $radius, $unit, $options = []): mixed { - return $this->lazyObjectReal->georadiusbymember_ro(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadiusbymember_ro(...\func_get_args()); } public function geosearch($key, $position, $shape, $unit, $options = []): array { - return $this->lazyObjectReal->geosearch(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geosearch(...\func_get_args()); } public function geosearchstore($dst, $src, $position, $shape, $unit, $options = []): \Redis|array|false|int { - return $this->lazyObjectReal->geosearchstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geosearchstore(...\func_get_args()); } public function get($key): mixed { - return $this->lazyObjectReal->get(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->get(...\func_get_args()); } public function getAuth(): mixed { - return $this->lazyObjectReal->getAuth(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getAuth(...\func_get_args()); } public function getBit($key, $idx): \Redis|false|int { - return $this->lazyObjectReal->getBit(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getBit(...\func_get_args()); } public function getEx($key, $options = []): \Redis|bool|string { - return $this->lazyObjectReal->getEx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getEx(...\func_get_args()); } public function getDBNum(): int { - return $this->lazyObjectReal->getDBNum(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getDBNum(...\func_get_args()); } public function getDel($key): \Redis|bool|string { - return $this->lazyObjectReal->getDel(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getDel(...\func_get_args()); } public function getHost(): string { - return $this->lazyObjectReal->getHost(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getHost(...\func_get_args()); } public function getLastError(): ?string { - return $this->lazyObjectReal->getLastError(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getLastError(...\func_get_args()); } public function getMode(): int { - return $this->lazyObjectReal->getMode(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getMode(...\func_get_args()); } public function getOption($option): mixed { - return $this->lazyObjectReal->getOption(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getOption(...\func_get_args()); } public function getPersistentID(): ?string { - return $this->lazyObjectReal->getPersistentID(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getPersistentID(...\func_get_args()); } public function getPort(): int { - return $this->lazyObjectReal->getPort(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getPort(...\func_get_args()); } public function getRange($key, $start, $end): \Redis|false|string { - return $this->lazyObjectReal->getRange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getRange(...\func_get_args()); } public function lcs($key1, $key2, $options = null): \Redis|array|false|int|string { - return $this->lazyObjectReal->lcs(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lcs(...\func_get_args()); } public function getReadTimeout(): float { - return $this->lazyObjectReal->getReadTimeout(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getReadTimeout(...\func_get_args()); } public function getset($key, $value): \Redis|false|string { - return $this->lazyObjectReal->getset(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getset(...\func_get_args()); } public function getTimeout(): false|float { - return $this->lazyObjectReal->getTimeout(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getTimeout(...\func_get_args()); } public function getTransferredBytes(): array { - return $this->lazyObjectReal->getTransferredBytes(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getTransferredBytes(...\func_get_args()); } public function clearTransferredBytes(): void { - $this->lazyObjectReal->clearTransferredBytes(...\func_get_args()); + ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->clearTransferredBytes(...\func_get_args()); } public function hDel($key, $field, ...$other_fields): \Redis|false|int { - return $this->lazyObjectReal->hDel(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hDel(...\func_get_args()); } public function hExists($key, $field): \Redis|bool { - return $this->lazyObjectReal->hExists(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hExists(...\func_get_args()); } public function hGet($key, $member): mixed { - return $this->lazyObjectReal->hGet(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hGet(...\func_get_args()); } public function hGetAll($key): \Redis|array|false { - return $this->lazyObjectReal->hGetAll(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hGetAll(...\func_get_args()); } public function hIncrBy($key, $field, $value): \Redis|false|int { - return $this->lazyObjectReal->hIncrBy(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hIncrBy(...\func_get_args()); } public function hIncrByFloat($key, $field, $value): \Redis|false|float { - return $this->lazyObjectReal->hIncrByFloat(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hIncrByFloat(...\func_get_args()); } public function hKeys($key): \Redis|array|false { - return $this->lazyObjectReal->hKeys(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hKeys(...\func_get_args()); } public function hLen($key): \Redis|false|int { - return $this->lazyObjectReal->hLen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hLen(...\func_get_args()); } public function hMget($key, $fields): \Redis|array|false { - return $this->lazyObjectReal->hMget(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hMget(...\func_get_args()); } public function hMset($key, $fieldvals): \Redis|bool { - return $this->lazyObjectReal->hMset(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hMset(...\func_get_args()); } public function hRandField($key, $options = null): \Redis|array|string { - return $this->lazyObjectReal->hRandField(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hRandField(...\func_get_args()); } public function hSet($key, $member, $value): \Redis|false|int { - return $this->lazyObjectReal->hSet(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hSet(...\func_get_args()); } public function hSetNx($key, $field, $value): \Redis|bool { - return $this->lazyObjectReal->hSetNx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hSetNx(...\func_get_args()); } public function hStrLen($key, $field): \Redis|false|int { - return $this->lazyObjectReal->hStrLen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hStrLen(...\func_get_args()); } public function hVals($key): \Redis|array|false { - return $this->lazyObjectReal->hVals(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hVals(...\func_get_args()); } public function hscan($key, &$iterator, $pattern = null, $count = 0): \Redis|array|bool { - return $this->lazyObjectReal->hscan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hscan($key, $iterator, $pattern, $count, ...\array_slice(\func_get_args(), 4)); } public function incr($key, $by = 1): \Redis|false|int { - return $this->lazyObjectReal->incr(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->incr(...\func_get_args()); } public function incrBy($key, $value): \Redis|false|int { - return $this->lazyObjectReal->incrBy(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->incrBy(...\func_get_args()); } public function incrByFloat($key, $value): \Redis|false|float { - return $this->lazyObjectReal->incrByFloat(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->incrByFloat(...\func_get_args()); } public function info(...$sections): \Redis|array|false { - return $this->lazyObjectReal->info(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->info(...\func_get_args()); } public function isConnected(): bool { - return $this->lazyObjectReal->isConnected(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->isConnected(...\func_get_args()); } public function keys($pattern) { - return $this->lazyObjectReal->keys(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->keys(...\func_get_args()); } public function lInsert($key, $pos, $pivot, $value) { - return $this->lazyObjectReal->lInsert(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lInsert(...\func_get_args()); } public function lLen($key): \Redis|false|int { - return $this->lazyObjectReal->lLen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lLen(...\func_get_args()); } public function lMove($src, $dst, $wherefrom, $whereto): \Redis|false|string { - return $this->lazyObjectReal->lMove(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lMove(...\func_get_args()); } public function blmove($src, $dst, $wherefrom, $whereto, $timeout): \Redis|false|string { - return $this->lazyObjectReal->blmove(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->blmove(...\func_get_args()); } public function lPop($key, $count = 0): \Redis|array|bool|string { - return $this->lazyObjectReal->lPop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lPop(...\func_get_args()); } public function lPos($key, $value, $options = null): \Redis|array|bool|int|null { - return $this->lazyObjectReal->lPos(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lPos(...\func_get_args()); } public function lPush($key, ...$elements): \Redis|false|int { - return $this->lazyObjectReal->lPush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lPush(...\func_get_args()); } public function rPush($key, ...$elements): \Redis|false|int { - return $this->lazyObjectReal->rPush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rPush(...\func_get_args()); } public function lPushx($key, $value): \Redis|false|int { - return $this->lazyObjectReal->lPushx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lPushx(...\func_get_args()); } public function rPushx($key, $value): \Redis|false|int { - return $this->lazyObjectReal->rPushx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rPushx(...\func_get_args()); } public function lSet($key, $index, $value): \Redis|bool { - return $this->lazyObjectReal->lSet(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lSet(...\func_get_args()); } public function lastSave(): int { - return $this->lazyObjectReal->lastSave(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lastSave(...\func_get_args()); } public function lindex($key, $index): mixed { - return $this->lazyObjectReal->lindex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lindex(...\func_get_args()); } public function lrange($key, $start, $end): \Redis|array|false { - return $this->lazyObjectReal->lrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lrange(...\func_get_args()); } public function lrem($key, $value, $count = 0): \Redis|false|int { - return $this->lazyObjectReal->lrem(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lrem(...\func_get_args()); } public function ltrim($key, $start, $end): \Redis|bool { - return $this->lazyObjectReal->ltrim(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->ltrim(...\func_get_args()); } public function mget($keys): \Redis|array { - return $this->lazyObjectReal->mget(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->mget(...\func_get_args()); } public function migrate($host, $port, $key, $dstdb, $timeout, $copy = false, $replace = false, #[\SensitiveParameter] $credentials = null): \Redis|bool { - return $this->lazyObjectReal->migrate(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->migrate(...\func_get_args()); } public function move($key, $index): \Redis|bool { - return $this->lazyObjectReal->move(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->move(...\func_get_args()); } public function mset($key_values): \Redis|bool { - return $this->lazyObjectReal->mset(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->mset(...\func_get_args()); } public function msetnx($key_values): \Redis|bool { - return $this->lazyObjectReal->msetnx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->msetnx(...\func_get_args()); } public function multi($value = \Redis::MULTI): \Redis|bool { - return $this->lazyObjectReal->multi(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->multi(...\func_get_args()); } public function object($subcommand, $key): \Redis|false|int|string { - return $this->lazyObjectReal->object(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->object(...\func_get_args()); } public function open($host, $port = 6379, $timeout = 0.0, $persistent_id = null, $retry_interval = 0, $read_timeout = 0.0, $context = null): bool { - return $this->lazyObjectReal->open(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->open(...\func_get_args()); } public function pconnect($host, $port = 6379, $timeout = 0.0, $persistent_id = null, $retry_interval = 0, $read_timeout = 0.0, $context = null): bool { - return $this->lazyObjectReal->pconnect(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pconnect(...\func_get_args()); } public function persist($key): \Redis|bool { - return $this->lazyObjectReal->persist(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->persist(...\func_get_args()); } public function pexpire($key, $timeout, $mode = null): bool { - return $this->lazyObjectReal->pexpire(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pexpire(...\func_get_args()); } public function pexpireAt($key, $timestamp, $mode = null): \Redis|bool { - return $this->lazyObjectReal->pexpireAt(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pexpireAt(...\func_get_args()); } public function pfadd($key, $elements): \Redis|int { - return $this->lazyObjectReal->pfadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pfadd(...\func_get_args()); } - public function pfcount($key): \Redis|int + public function pfcount($key_or_keys): \Redis|false|int { - return $this->lazyObjectReal->pfcount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pfcount(...\func_get_args()); } public function pfmerge($dst, $srckeys): \Redis|bool { - return $this->lazyObjectReal->pfmerge(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pfmerge(...\func_get_args()); } public function ping($message = null): \Redis|bool|string { - return $this->lazyObjectReal->ping(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->ping(...\func_get_args()); } public function pipeline(): \Redis|bool { - return $this->lazyObjectReal->pipeline(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pipeline(...\func_get_args()); } public function popen($host, $port = 6379, $timeout = 0.0, $persistent_id = null, $retry_interval = 0, $read_timeout = 0.0, $context = null): bool { - return $this->lazyObjectReal->popen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->popen(...\func_get_args()); } public function psetex($key, $expire, $value): \Redis|bool { - return $this->lazyObjectReal->psetex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->psetex(...\func_get_args()); } public function psubscribe($patterns, $cb): bool { - return $this->lazyObjectReal->psubscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->psubscribe(...\func_get_args()); } public function pttl($key): \Redis|false|int { - return $this->lazyObjectReal->pttl(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pttl(...\func_get_args()); } public function publish($channel, $message): \Redis|false|int { - return $this->lazyObjectReal->publish(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->publish(...\func_get_args()); } public function pubsub($command, $arg = null): mixed { - return $this->lazyObjectReal->pubsub(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pubsub(...\func_get_args()); } public function punsubscribe($patterns): \Redis|array|bool { - return $this->lazyObjectReal->punsubscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->punsubscribe(...\func_get_args()); } public function rPop($key, $count = 0): \Redis|array|bool|string { - return $this->lazyObjectReal->rPop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rPop(...\func_get_args()); } public function randomKey(): \Redis|false|string { - return $this->lazyObjectReal->randomKey(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->randomKey(...\func_get_args()); } public function rawcommand($command, ...$args): mixed { - return $this->lazyObjectReal->rawcommand(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rawcommand(...\func_get_args()); } public function rename($old_name, $new_name): \Redis|bool { - return $this->lazyObjectReal->rename(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rename(...\func_get_args()); } public function renameNx($key_src, $key_dst): \Redis|bool { - return $this->lazyObjectReal->renameNx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->renameNx(...\func_get_args()); } public function restore($key, $ttl, $value, $options = null): \Redis|bool { - return $this->lazyObjectReal->restore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->restore(...\func_get_args()); } public function role(): mixed { - return $this->lazyObjectReal->role(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->role(...\func_get_args()); } public function rpoplpush($srckey, $dstkey): \Redis|false|string { - return $this->lazyObjectReal->rpoplpush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rpoplpush(...\func_get_args()); } public function sAdd($key, $value, ...$other_values): \Redis|false|int { - return $this->lazyObjectReal->sAdd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sAdd(...\func_get_args()); } public function sAddArray($key, $values): int { - return $this->lazyObjectReal->sAddArray(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sAddArray(...\func_get_args()); } public function sDiff($key, ...$other_keys): \Redis|array|false { - return $this->lazyObjectReal->sDiff(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sDiff(...\func_get_args()); } public function sDiffStore($dst, $key, ...$other_keys): \Redis|false|int { - return $this->lazyObjectReal->sDiffStore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sDiffStore(...\func_get_args()); } public function sInter($key, ...$other_keys): \Redis|array|false { - return $this->lazyObjectReal->sInter(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sInter(...\func_get_args()); } public function sintercard($keys, $limit = -1): \Redis|false|int { - return $this->lazyObjectReal->sintercard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sintercard(...\func_get_args()); } public function sInterStore($key, ...$other_keys): \Redis|false|int { - return $this->lazyObjectReal->sInterStore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sInterStore(...\func_get_args()); } public function sMembers($key): \Redis|array|false { - return $this->lazyObjectReal->sMembers(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sMembers(...\func_get_args()); } public function sMisMember($key, $member, ...$other_members): \Redis|array|false { - return $this->lazyObjectReal->sMisMember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sMisMember(...\func_get_args()); } public function sMove($src, $dst, $value): \Redis|bool { - return $this->lazyObjectReal->sMove(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sMove(...\func_get_args()); } public function sPop($key, $count = 0): \Redis|array|false|string { - return $this->lazyObjectReal->sPop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sPop(...\func_get_args()); } public function sRandMember($key, $count = 0): \Redis|array|false|string { - return $this->lazyObjectReal->sRandMember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sRandMember(...\func_get_args()); } public function sUnion($key, ...$other_keys): \Redis|array|false { - return $this->lazyObjectReal->sUnion(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sUnion(...\func_get_args()); } public function sUnionStore($dst, $key, ...$other_keys): \Redis|false|int { - return $this->lazyObjectReal->sUnionStore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sUnionStore(...\func_get_args()); } public function save(): \Redis|bool { - return $this->lazyObjectReal->save(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->save(...\func_get_args()); } public function scan(&$iterator, $pattern = null, $count = 0, $type = null): array|false { - return $this->lazyObjectReal->scan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->scan($iterator, $pattern, $count, $type, ...\array_slice(\func_get_args(), 4)); } public function scard($key): \Redis|false|int { - return $this->lazyObjectReal->scard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->scard(...\func_get_args()); } public function script($command, ...$args): mixed { - return $this->lazyObjectReal->script(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->script(...\func_get_args()); } public function select($db): \Redis|bool { - return $this->lazyObjectReal->select(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->select(...\func_get_args()); } public function set($key, $value, $options = null): \Redis|bool|string { - return $this->lazyObjectReal->set(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->set(...\func_get_args()); } public function setBit($key, $idx, $value): \Redis|false|int { - return $this->lazyObjectReal->setBit(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setBit(...\func_get_args()); } public function setRange($key, $index, $value): \Redis|false|int { - return $this->lazyObjectReal->setRange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setRange(...\func_get_args()); } public function setOption($option, $value): bool { - return $this->lazyObjectReal->setOption(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setOption(...\func_get_args()); } public function setex($key, $expire, $value) { - return $this->lazyObjectReal->setex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setex(...\func_get_args()); } public function setnx($key, $value): \Redis|bool { - return $this->lazyObjectReal->setnx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setnx(...\func_get_args()); } public function sismember($key, $value): \Redis|bool { - return $this->lazyObjectReal->sismember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sismember(...\func_get_args()); } public function slaveof($host = null, $port = 6379): \Redis|bool { - return $this->lazyObjectReal->slaveof(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->slaveof(...\func_get_args()); } public function replicaof($host = null, $port = 6379): \Redis|bool { - return $this->lazyObjectReal->replicaof(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->replicaof(...\func_get_args()); } public function touch($key_or_array, ...$more_keys): \Redis|false|int { - return $this->lazyObjectReal->touch(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->touch(...\func_get_args()); } public function slowlog($operation, $length = 0): mixed { - return $this->lazyObjectReal->slowlog(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->slowlog(...\func_get_args()); } public function sort($key, $options = null): mixed { - return $this->lazyObjectReal->sort(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sort(...\func_get_args()); } public function sort_ro($key, $options = null): mixed { - return $this->lazyObjectReal->sort_ro(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sort_ro(...\func_get_args()); } public function sortAsc($key, $pattern = null, $get = null, $offset = -1, $count = -1, $store = null): array { - return $this->lazyObjectReal->sortAsc(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sortAsc(...\func_get_args()); } public function sortAscAlpha($key, $pattern = null, $get = null, $offset = -1, $count = -1, $store = null): array { - return $this->lazyObjectReal->sortAscAlpha(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sortAscAlpha(...\func_get_args()); } public function sortDesc($key, $pattern = null, $get = null, $offset = -1, $count = -1, $store = null): array { - return $this->lazyObjectReal->sortDesc(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sortDesc(...\func_get_args()); } public function sortDescAlpha($key, $pattern = null, $get = null, $offset = -1, $count = -1, $store = null): array { - return $this->lazyObjectReal->sortDescAlpha(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sortDescAlpha(...\func_get_args()); } public function srem($key, $value, ...$other_values): \Redis|false|int { - return $this->lazyObjectReal->srem(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->srem(...\func_get_args()); } public function sscan($key, &$iterator, $pattern = null, $count = 0): array|false { - return $this->lazyObjectReal->sscan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sscan($key, $iterator, $pattern, $count, ...\array_slice(\func_get_args(), 4)); } public function ssubscribe($channels, $cb): bool { - return $this->lazyObjectReal->ssubscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->ssubscribe(...\func_get_args()); } public function strlen($key): \Redis|false|int { - return $this->lazyObjectReal->strlen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->strlen(...\func_get_args()); } public function subscribe($channels, $cb): bool { - return $this->lazyObjectReal->subscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->subscribe(...\func_get_args()); } public function sunsubscribe($channels): \Redis|array|bool { - return $this->lazyObjectReal->sunsubscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sunsubscribe(...\func_get_args()); } public function swapdb($src, $dst): \Redis|bool { - return $this->lazyObjectReal->swapdb(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->swapdb(...\func_get_args()); } public function time(): \Redis|array { - return $this->lazyObjectReal->time(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->time(...\func_get_args()); } public function ttl($key): \Redis|false|int { - return $this->lazyObjectReal->ttl(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->ttl(...\func_get_args()); } public function type($key): \Redis|false|int { - return $this->lazyObjectReal->type(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->type(...\func_get_args()); } public function unlink($key, ...$other_keys): \Redis|false|int { - return $this->lazyObjectReal->unlink(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->unlink(...\func_get_args()); } public function unsubscribe($channels): \Redis|array|bool { - return $this->lazyObjectReal->unsubscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->unsubscribe(...\func_get_args()); } public function unwatch(): \Redis|bool { - return $this->lazyObjectReal->unwatch(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->unwatch(...\func_get_args()); } public function watch($key, ...$other_keys): \Redis|bool { - return $this->lazyObjectReal->watch(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->watch(...\func_get_args()); } public function wait($numreplicas, $timeout): false|int { - return $this->lazyObjectReal->wait(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->wait(...\func_get_args()); } public function xack($key, $group, $ids): false|int { - return $this->lazyObjectReal->xack(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xack(...\func_get_args()); } public function xadd($key, $id, $values, $maxlen = 0, $approx = false, $nomkstream = false): \Redis|false|string { - return $this->lazyObjectReal->xadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xadd(...\func_get_args()); } public function xautoclaim($key, $group, $consumer, $min_idle, $start, $count = -1, $justid = false): \Redis|array|bool { - return $this->lazyObjectReal->xautoclaim(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xautoclaim(...\func_get_args()); } public function xclaim($key, $group, $consumer, $min_idle, $ids, $options): \Redis|array|bool { - return $this->lazyObjectReal->xclaim(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xclaim(...\func_get_args()); } public function xdel($key, $ids): \Redis|false|int { - return $this->lazyObjectReal->xdel(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xdel(...\func_get_args()); } public function xgroup($operation, $key = null, $group = null, $id_or_consumer = null, $mkstream = false, $entries_read = -2): mixed { - return $this->lazyObjectReal->xgroup(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xgroup(...\func_get_args()); } public function xinfo($operation, $arg1 = null, $arg2 = null, $count = -1): mixed { - return $this->lazyObjectReal->xinfo(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xinfo(...\func_get_args()); } public function xlen($key): \Redis|false|int { - return $this->lazyObjectReal->xlen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xlen(...\func_get_args()); } public function xpending($key, $group, $start = null, $end = null, $count = -1, $consumer = null): \Redis|array|false { - return $this->lazyObjectReal->xpending(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xpending(...\func_get_args()); } public function xrange($key, $start, $end, $count = -1): \Redis|array|bool { - return $this->lazyObjectReal->xrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xrange(...\func_get_args()); } public function xread($streams, $count = -1, $block = -1): \Redis|array|bool { - return $this->lazyObjectReal->xread(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xread(...\func_get_args()); } public function xreadgroup($group, $consumer, $streams, $count = 1, $block = 1): \Redis|array|bool { - return $this->lazyObjectReal->xreadgroup(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xreadgroup(...\func_get_args()); } public function xrevrange($key, $end, $start, $count = -1): \Redis|array|bool { - return $this->lazyObjectReal->xrevrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xrevrange(...\func_get_args()); } public function xtrim($key, $threshold, $approx = false, $minid = false, $limit = -1): \Redis|false|int { - return $this->lazyObjectReal->xtrim(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xtrim(...\func_get_args()); } - public function zAdd($key, $score_or_options, ...$more_scores_and_mems): \Redis|false|int + public function zAdd($key, $score_or_options, ...$more_scores_and_mems): \Redis|false|float|int { - return $this->lazyObjectReal->zAdd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zAdd(...\func_get_args()); } public function zCard($key): \Redis|false|int { - return $this->lazyObjectReal->zCard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zCard(...\func_get_args()); } public function zCount($key, $start, $end): \Redis|false|int { - return $this->lazyObjectReal->zCount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zCount(...\func_get_args()); } public function zIncrBy($key, $value, $member): \Redis|false|float { - return $this->lazyObjectReal->zIncrBy(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zIncrBy(...\func_get_args()); } public function zLexCount($key, $min, $max): \Redis|false|int { - return $this->lazyObjectReal->zLexCount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zLexCount(...\func_get_args()); } public function zMscore($key, $member, ...$other_members): \Redis|array|false { - return $this->lazyObjectReal->zMscore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zMscore(...\func_get_args()); } public function zPopMax($key, $count = null): \Redis|array|false { - return $this->lazyObjectReal->zPopMax(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zPopMax(...\func_get_args()); } public function zPopMin($key, $count = null): \Redis|array|false { - return $this->lazyObjectReal->zPopMin(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zPopMin(...\func_get_args()); } public function zRange($key, $start, $end, $options = null): \Redis|array|false { - return $this->lazyObjectReal->zRange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRange(...\func_get_args()); } public function zRangeByLex($key, $min, $max, $offset = -1, $count = -1): \Redis|array|false { - return $this->lazyObjectReal->zRangeByLex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRangeByLex(...\func_get_args()); } public function zRangeByScore($key, $start, $end, $options = []): \Redis|array|false { - return $this->lazyObjectReal->zRangeByScore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRangeByScore(...\func_get_args()); } public function zrangestore($dstkey, $srckey, $start, $end, $options = null): \Redis|false|int { - return $this->lazyObjectReal->zrangestore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrangestore(...\func_get_args()); } public function zRandMember($key, $options = null): \Redis|array|string { - return $this->lazyObjectReal->zRandMember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRandMember(...\func_get_args()); } public function zRank($key, $member): \Redis|false|int { - return $this->lazyObjectReal->zRank(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRank(...\func_get_args()); } public function zRem($key, $member, ...$other_members): \Redis|false|int { - return $this->lazyObjectReal->zRem(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRem(...\func_get_args()); } public function zRemRangeByLex($key, $min, $max): \Redis|false|int { - return $this->lazyObjectReal->zRemRangeByLex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRemRangeByLex(...\func_get_args()); } public function zRemRangeByRank($key, $start, $end): \Redis|false|int { - return $this->lazyObjectReal->zRemRangeByRank(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRemRangeByRank(...\func_get_args()); } public function zRemRangeByScore($key, $start, $end): \Redis|false|int { - return $this->lazyObjectReal->zRemRangeByScore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRemRangeByScore(...\func_get_args()); } public function zRevRange($key, $start, $end, $scores = null): \Redis|array|false { - return $this->lazyObjectReal->zRevRange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRevRange(...\func_get_args()); } public function zRevRangeByLex($key, $max, $min, $offset = -1, $count = -1): \Redis|array|false { - return $this->lazyObjectReal->zRevRangeByLex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRevRangeByLex(...\func_get_args()); } public function zRevRangeByScore($key, $max, $min, $options = []): \Redis|array|false { - return $this->lazyObjectReal->zRevRangeByScore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRevRangeByScore(...\func_get_args()); } public function zRevRank($key, $member): \Redis|false|int { - return $this->lazyObjectReal->zRevRank(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zRevRank(...\func_get_args()); } public function zScore($key, $member): \Redis|false|float { - return $this->lazyObjectReal->zScore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zScore(...\func_get_args()); } public function zdiff($keys, $options = null): \Redis|array|false { - return $this->lazyObjectReal->zdiff(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zdiff(...\func_get_args()); } public function zdiffstore($dst, $keys): \Redis|false|int { - return $this->lazyObjectReal->zdiffstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zdiffstore(...\func_get_args()); } public function zinter($keys, $weights = null, $options = null): \Redis|array|false { - return $this->lazyObjectReal->zinter(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zinter(...\func_get_args()); } public function zintercard($keys, $limit = -1): \Redis|false|int { - return $this->lazyObjectReal->zintercard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zintercard(...\func_get_args()); } public function zinterstore($dst, $keys, $weights = null, $aggregate = null): \Redis|false|int { - return $this->lazyObjectReal->zinterstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zinterstore(...\func_get_args()); } public function zscan($key, &$iterator, $pattern = null, $count = 0): \Redis|array|false { - return $this->lazyObjectReal->zscan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zscan($key, $iterator, $pattern, $count, ...\array_slice(\func_get_args(), 4)); } public function zunion($keys, $weights = null, $options = null): \Redis|array|false { - return $this->lazyObjectReal->zunion(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zunion(...\func_get_args()); } public function zunionstore($dst, $keys, $weights = null, $aggregate = null): \Redis|false|int { - return $this->lazyObjectReal->zunionstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zunionstore(...\func_get_args()); } } diff --git a/Traits/RedisCluster5Proxy.php b/Traits/RedisCluster5Proxy.php index d95aced0..6e3f172e 100644 --- a/Traits/RedisCluster5Proxy.php +++ b/Traits/RedisCluster5Proxy.php @@ -29,958 +29,955 @@ class RedisCluster5Proxy extends \RedisCluster implements ResetInterface, LazyOb resetLazyObject as reset; } - private const LAZY_OBJECT_PROPERTY_SCOPES = [ - 'lazyObjectReal' => [self::class, 'lazyObjectReal', null], - "\0".self::class."\0lazyObjectReal" => [self::class, 'lazyObjectReal', null], - ]; + private const LAZY_OBJECT_PROPERTY_SCOPES = []; public function __construct($name, $seeds = null, $timeout = null, $read_timeout = null, $persistent = null, $auth = null) { - return $this->lazyObjectReal->__construct(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->__construct(...\func_get_args()); } public function _masters() { - return $this->lazyObjectReal->_masters(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_masters(...\func_get_args()); } public function _prefix($key) { - return $this->lazyObjectReal->_prefix(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_prefix(...\func_get_args()); } public function _redir() { - return $this->lazyObjectReal->_redir(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_redir(...\func_get_args()); } public function _serialize($value) { - return $this->lazyObjectReal->_serialize(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_serialize(...\func_get_args()); } public function _unserialize($value) { - return $this->lazyObjectReal->_unserialize(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_unserialize(...\func_get_args()); } public function _compress($value) { - return $this->lazyObjectReal->_compress(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_compress(...\func_get_args()); } public function _uncompress($value) { - return $this->lazyObjectReal->_uncompress(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_uncompress(...\func_get_args()); } public function _pack($value) { - return $this->lazyObjectReal->_pack(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_pack(...\func_get_args()); } public function _unpack($value) { - return $this->lazyObjectReal->_unpack(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_unpack(...\func_get_args()); } public function acl($key_or_address, $subcmd, ...$args) { - return $this->lazyObjectReal->acl(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->acl(...\func_get_args()); } public function append($key, $value) { - return $this->lazyObjectReal->append(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->append(...\func_get_args()); } public function bgrewriteaof($key_or_address) { - return $this->lazyObjectReal->bgrewriteaof(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bgrewriteaof(...\func_get_args()); } public function bgsave($key_or_address) { - return $this->lazyObjectReal->bgsave(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bgsave(...\func_get_args()); } public function bitcount($key) { - return $this->lazyObjectReal->bitcount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bitcount(...\func_get_args()); } public function bitop($operation, $ret_key, $key, ...$other_keys) { - return $this->lazyObjectReal->bitop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bitop(...\func_get_args()); } public function bitpos($key, $bit, $start = null, $end = null) { - return $this->lazyObjectReal->bitpos(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bitpos(...\func_get_args()); } public function blpop($key, $timeout_or_key, ...$extra_args) { - return $this->lazyObjectReal->blpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->blpop(...\func_get_args()); } public function brpop($key, $timeout_or_key, ...$extra_args) { - return $this->lazyObjectReal->brpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->brpop(...\func_get_args()); } public function brpoplpush($src, $dst, $timeout) { - return $this->lazyObjectReal->brpoplpush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->brpoplpush(...\func_get_args()); } public function clearlasterror() { - return $this->lazyObjectReal->clearlasterror(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->clearlasterror(...\func_get_args()); } public function bzpopmax($key, $timeout_or_key, ...$extra_args) { - return $this->lazyObjectReal->bzpopmax(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bzpopmax(...\func_get_args()); } public function bzpopmin($key, $timeout_or_key, ...$extra_args) { - return $this->lazyObjectReal->bzpopmin(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bzpopmin(...\func_get_args()); } public function client($key_or_address, $arg = null, ...$other_args) { - return $this->lazyObjectReal->client(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->client(...\func_get_args()); } public function close() { - return $this->lazyObjectReal->close(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->close(...\func_get_args()); } public function cluster($key_or_address, $arg = null, ...$other_args) { - return $this->lazyObjectReal->cluster(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->cluster(...\func_get_args()); } public function command(...$args) { - return $this->lazyObjectReal->command(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->command(...\func_get_args()); } public function config($key_or_address, $arg = null, ...$other_args) { - return $this->lazyObjectReal->config(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->config(...\func_get_args()); } public function dbsize($key_or_address) { - return $this->lazyObjectReal->dbsize(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->dbsize(...\func_get_args()); } public function decr($key) { - return $this->lazyObjectReal->decr(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->decr(...\func_get_args()); } public function decrby($key, $value) { - return $this->lazyObjectReal->decrby(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->decrby(...\func_get_args()); } public function del($key, ...$other_keys) { - return $this->lazyObjectReal->del(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->del(...\func_get_args()); } public function discard() { - return $this->lazyObjectReal->discard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->discard(...\func_get_args()); } public function dump($key) { - return $this->lazyObjectReal->dump(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->dump(...\func_get_args()); } public function echo($msg) { - return $this->lazyObjectReal->echo(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->echo(...\func_get_args()); } public function eval($script, $args = null, $num_keys = null) { - return $this->lazyObjectReal->eval(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->eval(...\func_get_args()); } public function evalsha($script_sha, $args = null, $num_keys = null) { - return $this->lazyObjectReal->evalsha(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->evalsha(...\func_get_args()); } public function exec() { - return $this->lazyObjectReal->exec(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->exec(...\func_get_args()); } public function exists($key) { - return $this->lazyObjectReal->exists(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->exists(...\func_get_args()); } public function expire($key, $timeout) { - return $this->lazyObjectReal->expire(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->expire(...\func_get_args()); } public function expireat($key, $timestamp) { - return $this->lazyObjectReal->expireat(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->expireat(...\func_get_args()); } public function flushall($key_or_address, $async = null) { - return $this->lazyObjectReal->flushall(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->flushall(...\func_get_args()); } public function flushdb($key_or_address, $async = null) { - return $this->lazyObjectReal->flushdb(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->flushdb(...\func_get_args()); } public function geoadd($key, $lng, $lat, $member, ...$other_triples) { - return $this->lazyObjectReal->geoadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geoadd(...\func_get_args()); } public function geodist($key, $src, $dst, $unit = null) { - return $this->lazyObjectReal->geodist(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geodist(...\func_get_args()); } public function geohash($key, $member, ...$other_members) { - return $this->lazyObjectReal->geohash(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geohash(...\func_get_args()); } public function geopos($key, $member, ...$other_members) { - return $this->lazyObjectReal->geopos(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geopos(...\func_get_args()); } public function georadius($key, $lng, $lan, $radius, $unit, $opts = null) { - return $this->lazyObjectReal->georadius(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadius(...\func_get_args()); } public function georadius_ro($key, $lng, $lan, $radius, $unit, $opts = null) { - return $this->lazyObjectReal->georadius_ro(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadius_ro(...\func_get_args()); } public function georadiusbymember($key, $member, $radius, $unit, $opts = null) { - return $this->lazyObjectReal->georadiusbymember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadiusbymember(...\func_get_args()); } public function georadiusbymember_ro($key, $member, $radius, $unit, $opts = null) { - return $this->lazyObjectReal->georadiusbymember_ro(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadiusbymember_ro(...\func_get_args()); } public function get($key) { - return $this->lazyObjectReal->get(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->get(...\func_get_args()); } public function getbit($key, $offset) { - return $this->lazyObjectReal->getbit(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getbit(...\func_get_args()); } public function getlasterror() { - return $this->lazyObjectReal->getlasterror(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getlasterror(...\func_get_args()); } public function getmode() { - return $this->lazyObjectReal->getmode(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getmode(...\func_get_args()); } public function getoption($option) { - return $this->lazyObjectReal->getoption(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getoption(...\func_get_args()); } public function getrange($key, $start, $end) { - return $this->lazyObjectReal->getrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getrange(...\func_get_args()); } public function getset($key, $value) { - return $this->lazyObjectReal->getset(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getset(...\func_get_args()); } public function hdel($key, $member, ...$other_members) { - return $this->lazyObjectReal->hdel(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hdel(...\func_get_args()); } public function hexists($key, $member) { - return $this->lazyObjectReal->hexists(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hexists(...\func_get_args()); } public function hget($key, $member) { - return $this->lazyObjectReal->hget(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hget(...\func_get_args()); } public function hgetall($key) { - return $this->lazyObjectReal->hgetall(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hgetall(...\func_get_args()); } public function hincrby($key, $member, $value) { - return $this->lazyObjectReal->hincrby(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hincrby(...\func_get_args()); } public function hincrbyfloat($key, $member, $value) { - return $this->lazyObjectReal->hincrbyfloat(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hincrbyfloat(...\func_get_args()); } public function hkeys($key) { - return $this->lazyObjectReal->hkeys(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hkeys(...\func_get_args()); } public function hlen($key) { - return $this->lazyObjectReal->hlen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hlen(...\func_get_args()); } public function hmget($key, $keys) { - return $this->lazyObjectReal->hmget(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hmget(...\func_get_args()); } public function hmset($key, $pairs) { - return $this->lazyObjectReal->hmset(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hmset(...\func_get_args()); } public function hscan($str_key, &$i_iterator, $str_pattern = null, $i_count = null) { - return $this->lazyObjectReal->hscan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hscan($str_key, $i_iterator, $str_pattern, $i_count, ...\array_slice(\func_get_args(), 4)); } public function hset($key, $member, $value) { - return $this->lazyObjectReal->hset(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hset(...\func_get_args()); } public function hsetnx($key, $member, $value) { - return $this->lazyObjectReal->hsetnx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hsetnx(...\func_get_args()); } public function hstrlen($key, $member) { - return $this->lazyObjectReal->hstrlen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hstrlen(...\func_get_args()); } public function hvals($key) { - return $this->lazyObjectReal->hvals(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hvals(...\func_get_args()); } public function incr($key) { - return $this->lazyObjectReal->incr(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->incr(...\func_get_args()); } public function incrby($key, $value) { - return $this->lazyObjectReal->incrby(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->incrby(...\func_get_args()); } public function incrbyfloat($key, $value) { - return $this->lazyObjectReal->incrbyfloat(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->incrbyfloat(...\func_get_args()); } public function info($key_or_address, $option = null) { - return $this->lazyObjectReal->info(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->info(...\func_get_args()); } public function keys($pattern) { - return $this->lazyObjectReal->keys(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->keys(...\func_get_args()); } public function lastsave($key_or_address) { - return $this->lazyObjectReal->lastsave(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lastsave(...\func_get_args()); } public function lget($key, $index) { - return $this->lazyObjectReal->lget(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lget(...\func_get_args()); } public function lindex($key, $index) { - return $this->lazyObjectReal->lindex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lindex(...\func_get_args()); } public function linsert($key, $position, $pivot, $value) { - return $this->lazyObjectReal->linsert(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->linsert(...\func_get_args()); } public function llen($key) { - return $this->lazyObjectReal->llen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->llen(...\func_get_args()); } public function lpop($key) { - return $this->lazyObjectReal->lpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lpop(...\func_get_args()); } public function lpush($key, $value) { - return $this->lazyObjectReal->lpush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lpush(...\func_get_args()); } public function lpushx($key, $value) { - return $this->lazyObjectReal->lpushx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lpushx(...\func_get_args()); } public function lrange($key, $start, $end) { - return $this->lazyObjectReal->lrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lrange(...\func_get_args()); } public function lrem($key, $value) { - return $this->lazyObjectReal->lrem(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lrem(...\func_get_args()); } public function lset($key, $index, $value) { - return $this->lazyObjectReal->lset(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lset(...\func_get_args()); } public function ltrim($key, $start, $stop) { - return $this->lazyObjectReal->ltrim(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->ltrim(...\func_get_args()); } public function mget($keys) { - return $this->lazyObjectReal->mget(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->mget(...\func_get_args()); } public function mset($pairs) { - return $this->lazyObjectReal->mset(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->mset(...\func_get_args()); } public function msetnx($pairs) { - return $this->lazyObjectReal->msetnx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->msetnx(...\func_get_args()); } public function multi() { - return $this->lazyObjectReal->multi(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->multi(...\func_get_args()); } public function object($field, $key) { - return $this->lazyObjectReal->object(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->object(...\func_get_args()); } public function persist($key) { - return $this->lazyObjectReal->persist(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->persist(...\func_get_args()); } public function pexpire($key, $timestamp) { - return $this->lazyObjectReal->pexpire(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pexpire(...\func_get_args()); } public function pexpireat($key, $timestamp) { - return $this->lazyObjectReal->pexpireat(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pexpireat(...\func_get_args()); } public function pfadd($key, $elements) { - return $this->lazyObjectReal->pfadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pfadd(...\func_get_args()); } public function pfcount($key) { - return $this->lazyObjectReal->pfcount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pfcount(...\func_get_args()); } public function pfmerge($dstkey, $keys) { - return $this->lazyObjectReal->pfmerge(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pfmerge(...\func_get_args()); } public function ping($key_or_address) { - return $this->lazyObjectReal->ping(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->ping(...\func_get_args()); } public function psetex($key, $expire, $value) { - return $this->lazyObjectReal->psetex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->psetex(...\func_get_args()); } public function psubscribe($patterns, $callback) { - return $this->lazyObjectReal->psubscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->psubscribe(...\func_get_args()); } public function pttl($key) { - return $this->lazyObjectReal->pttl(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pttl(...\func_get_args()); } public function publish($channel, $message) { - return $this->lazyObjectReal->publish(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->publish(...\func_get_args()); } public function pubsub($key_or_address, $arg = null, ...$other_args) { - return $this->lazyObjectReal->pubsub(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pubsub(...\func_get_args()); } public function punsubscribe($pattern, ...$other_patterns) { - return $this->lazyObjectReal->punsubscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->punsubscribe(...\func_get_args()); } public function randomkey($key_or_address) { - return $this->lazyObjectReal->randomkey(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->randomkey(...\func_get_args()); } public function rawcommand($cmd, ...$args) { - return $this->lazyObjectReal->rawcommand(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rawcommand(...\func_get_args()); } public function rename($key, $newkey) { - return $this->lazyObjectReal->rename(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rename(...\func_get_args()); } public function renamenx($key, $newkey) { - return $this->lazyObjectReal->renamenx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->renamenx(...\func_get_args()); } public function restore($ttl, $key, $value) { - return $this->lazyObjectReal->restore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->restore(...\func_get_args()); } public function role() { - return $this->lazyObjectReal->role(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->role(...\func_get_args()); } public function rpop($key) { - return $this->lazyObjectReal->rpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rpop(...\func_get_args()); } public function rpoplpush($src, $dst) { - return $this->lazyObjectReal->rpoplpush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rpoplpush(...\func_get_args()); } public function rpush($key, $value) { - return $this->lazyObjectReal->rpush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rpush(...\func_get_args()); } public function rpushx($key, $value) { - return $this->lazyObjectReal->rpushx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rpushx(...\func_get_args()); } public function sadd($key, $value) { - return $this->lazyObjectReal->sadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sadd(...\func_get_args()); } public function saddarray($key, $options) { - return $this->lazyObjectReal->saddarray(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->saddarray(...\func_get_args()); } public function save($key_or_address) { - return $this->lazyObjectReal->save(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->save(...\func_get_args()); } public function scan(&$i_iterator, $str_node, $str_pattern = null, $i_count = null) { - return $this->lazyObjectReal->scan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->scan($i_iterator, $str_node, $str_pattern, $i_count, ...\array_slice(\func_get_args(), 4)); } public function scard($key) { - return $this->lazyObjectReal->scard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->scard(...\func_get_args()); } public function script($key_or_address, $arg = null, ...$other_args) { - return $this->lazyObjectReal->script(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->script(...\func_get_args()); } public function sdiff($key, ...$other_keys) { - return $this->lazyObjectReal->sdiff(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sdiff(...\func_get_args()); } public function sdiffstore($dst, $key, ...$other_keys) { - return $this->lazyObjectReal->sdiffstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sdiffstore(...\func_get_args()); } public function set($key, $value, $opts = null) { - return $this->lazyObjectReal->set(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->set(...\func_get_args()); } public function setbit($key, $offset, $value) { - return $this->lazyObjectReal->setbit(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setbit(...\func_get_args()); } public function setex($key, $expire, $value) { - return $this->lazyObjectReal->setex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setex(...\func_get_args()); } public function setnx($key, $value) { - return $this->lazyObjectReal->setnx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setnx(...\func_get_args()); } public function setoption($option, $value) { - return $this->lazyObjectReal->setoption(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setoption(...\func_get_args()); } public function setrange($key, $offset, $value) { - return $this->lazyObjectReal->setrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setrange(...\func_get_args()); } public function sinter($key, ...$other_keys) { - return $this->lazyObjectReal->sinter(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sinter(...\func_get_args()); } public function sinterstore($dst, $key, ...$other_keys) { - return $this->lazyObjectReal->sinterstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sinterstore(...\func_get_args()); } public function sismember($key, $value) { - return $this->lazyObjectReal->sismember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sismember(...\func_get_args()); } public function slowlog($key_or_address, $arg = null, ...$other_args) { - return $this->lazyObjectReal->slowlog(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->slowlog(...\func_get_args()); } public function smembers($key) { - return $this->lazyObjectReal->smembers(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->smembers(...\func_get_args()); } public function smove($src, $dst, $value) { - return $this->lazyObjectReal->smove(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->smove(...\func_get_args()); } public function sort($key, $options = null) { - return $this->lazyObjectReal->sort(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sort(...\func_get_args()); } public function spop($key) { - return $this->lazyObjectReal->spop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->spop(...\func_get_args()); } public function srandmember($key, $count = null) { - return $this->lazyObjectReal->srandmember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->srandmember(...\func_get_args()); } public function srem($key, $value) { - return $this->lazyObjectReal->srem(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->srem(...\func_get_args()); } public function sscan($str_key, &$i_iterator, $str_pattern = null, $i_count = null) { - return $this->lazyObjectReal->sscan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sscan($str_key, $i_iterator, $str_pattern, $i_count, ...\array_slice(\func_get_args(), 4)); } public function strlen($key) { - return $this->lazyObjectReal->strlen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->strlen(...\func_get_args()); } public function subscribe($channels, $callback) { - return $this->lazyObjectReal->subscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->subscribe(...\func_get_args()); } public function sunion($key, ...$other_keys) { - return $this->lazyObjectReal->sunion(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sunion(...\func_get_args()); } public function sunionstore($dst, $key, ...$other_keys) { - return $this->lazyObjectReal->sunionstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sunionstore(...\func_get_args()); } public function time() { - return $this->lazyObjectReal->time(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->time(...\func_get_args()); } public function ttl($key) { - return $this->lazyObjectReal->ttl(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->ttl(...\func_get_args()); } public function type($key) { - return $this->lazyObjectReal->type(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->type(...\func_get_args()); } public function unsubscribe($channel, ...$other_channels) { - return $this->lazyObjectReal->unsubscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->unsubscribe(...\func_get_args()); } public function unlink($key, ...$other_keys) { - return $this->lazyObjectReal->unlink(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->unlink(...\func_get_args()); } public function unwatch() { - return $this->lazyObjectReal->unwatch(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->unwatch(...\func_get_args()); } public function watch($key, ...$other_keys) { - return $this->lazyObjectReal->watch(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->watch(...\func_get_args()); } public function xack($str_key, $str_group, $arr_ids) { - return $this->lazyObjectReal->xack(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xack(...\func_get_args()); } public function xadd($str_key, $str_id, $arr_fields, $i_maxlen = null, $boo_approximate = null) { - return $this->lazyObjectReal->xadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xadd(...\func_get_args()); } public function xclaim($str_key, $str_group, $str_consumer, $i_min_idle, $arr_ids, $arr_opts = null) { - return $this->lazyObjectReal->xclaim(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xclaim(...\func_get_args()); } public function xdel($str_key, $arr_ids) { - return $this->lazyObjectReal->xdel(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xdel(...\func_get_args()); } public function xgroup($str_operation, $str_key = null, $str_arg1 = null, $str_arg2 = null, $str_arg3 = null) { - return $this->lazyObjectReal->xgroup(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xgroup(...\func_get_args()); } public function xinfo($str_cmd, $str_key = null, $str_group = null) { - return $this->lazyObjectReal->xinfo(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xinfo(...\func_get_args()); } public function xlen($key) { - return $this->lazyObjectReal->xlen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xlen(...\func_get_args()); } public function xpending($str_key, $str_group, $str_start = null, $str_end = null, $i_count = null, $str_consumer = null) { - return $this->lazyObjectReal->xpending(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xpending(...\func_get_args()); } public function xrange($str_key, $str_start, $str_end, $i_count = null) { - return $this->lazyObjectReal->xrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xrange(...\func_get_args()); } public function xread($arr_streams, $i_count = null, $i_block = null) { - return $this->lazyObjectReal->xread(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xread(...\func_get_args()); } public function xreadgroup($str_group, $str_consumer, $arr_streams, $i_count = null, $i_block = null) { - return $this->lazyObjectReal->xreadgroup(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xreadgroup(...\func_get_args()); } public function xrevrange($str_key, $str_start, $str_end, $i_count = null) { - return $this->lazyObjectReal->xrevrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xrevrange(...\func_get_args()); } public function xtrim($str_key, $i_maxlen, $boo_approximate = null) { - return $this->lazyObjectReal->xtrim(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xtrim(...\func_get_args()); } public function zadd($key, $score, $value, ...$extra_args) { - return $this->lazyObjectReal->zadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zadd(...\func_get_args()); } public function zcard($key) { - return $this->lazyObjectReal->zcard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zcard(...\func_get_args()); } public function zcount($key, $min, $max) { - return $this->lazyObjectReal->zcount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zcount(...\func_get_args()); } public function zincrby($key, $value, $member) { - return $this->lazyObjectReal->zincrby(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zincrby(...\func_get_args()); } public function zinterstore($key, $keys, $weights = null, $aggregate = null) { - return $this->lazyObjectReal->zinterstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zinterstore(...\func_get_args()); } public function zlexcount($key, $min, $max) { - return $this->lazyObjectReal->zlexcount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zlexcount(...\func_get_args()); } public function zpopmax($key) { - return $this->lazyObjectReal->zpopmax(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zpopmax(...\func_get_args()); } public function zpopmin($key) { - return $this->lazyObjectReal->zpopmin(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zpopmin(...\func_get_args()); } public function zrange($key, $start, $end, $scores = null) { - return $this->lazyObjectReal->zrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrange(...\func_get_args()); } public function zrangebylex($key, $min, $max, $offset = null, $limit = null) { - return $this->lazyObjectReal->zrangebylex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrangebylex(...\func_get_args()); } public function zrangebyscore($key, $start, $end, $options = null) { - return $this->lazyObjectReal->zrangebyscore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrangebyscore(...\func_get_args()); } public function zrank($key, $member) { - return $this->lazyObjectReal->zrank(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrank(...\func_get_args()); } public function zrem($key, $member, ...$other_members) { - return $this->lazyObjectReal->zrem(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrem(...\func_get_args()); } public function zremrangebylex($key, $min, $max) { - return $this->lazyObjectReal->zremrangebylex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zremrangebylex(...\func_get_args()); } public function zremrangebyrank($key, $min, $max) { - return $this->lazyObjectReal->zremrangebyrank(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zremrangebyrank(...\func_get_args()); } public function zremrangebyscore($key, $min, $max) { - return $this->lazyObjectReal->zremrangebyscore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zremrangebyscore(...\func_get_args()); } public function zrevrange($key, $start, $end, $scores = null) { - return $this->lazyObjectReal->zrevrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrevrange(...\func_get_args()); } public function zrevrangebylex($key, $min, $max, $offset = null, $limit = null) { - return $this->lazyObjectReal->zrevrangebylex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrevrangebylex(...\func_get_args()); } public function zrevrangebyscore($key, $start, $end, $options = null) { - return $this->lazyObjectReal->zrevrangebyscore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrevrangebyscore(...\func_get_args()); } public function zrevrank($key, $member) { - return $this->lazyObjectReal->zrevrank(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrevrank(...\func_get_args()); } public function zscan($str_key, &$i_iterator, $str_pattern = null, $i_count = null) { - return $this->lazyObjectReal->zscan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zscan($str_key, $i_iterator, $str_pattern, $i_count, ...\array_slice(\func_get_args(), 4)); } public function zscore($key, $member) { - return $this->lazyObjectReal->zscore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zscore(...\func_get_args()); } public function zunionstore($key, $keys, $weights = null, $aggregate = null) { - return $this->lazyObjectReal->zunionstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zunionstore(...\func_get_args()); } } diff --git a/Traits/RedisCluster6Proxy.php b/Traits/RedisCluster6Proxy.php index e94fa2b3..9b52a314 100644 --- a/Traits/RedisCluster6Proxy.php +++ b/Traits/RedisCluster6Proxy.php @@ -29,1118 +29,1115 @@ class RedisCluster6Proxy extends \RedisCluster implements ResetInterface, LazyOb resetLazyObject as reset; } - private const LAZY_OBJECT_PROPERTY_SCOPES = [ - 'lazyObjectReal' => [self::class, 'lazyObjectReal', null], - "\0".self::class."\0lazyObjectReal" => [self::class, 'lazyObjectReal', null], - ]; + private const LAZY_OBJECT_PROPERTY_SCOPES = []; public function __construct($name, $seeds = null, $timeout = 0, $read_timeout = 0, $persistent = false, #[\SensitiveParameter] $auth = null, $context = null) { - return $this->lazyObjectReal->__construct(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->__construct(...\func_get_args()); } public function _compress($value): string { - return $this->lazyObjectReal->_compress(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_compress(...\func_get_args()); } public function _uncompress($value): string { - return $this->lazyObjectReal->_uncompress(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_uncompress(...\func_get_args()); } public function _serialize($value): bool|string { - return $this->lazyObjectReal->_serialize(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_serialize(...\func_get_args()); } public function _unserialize($value): mixed { - return $this->lazyObjectReal->_unserialize(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_unserialize(...\func_get_args()); } public function _pack($value): string { - return $this->lazyObjectReal->_pack(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_pack(...\func_get_args()); } public function _unpack($value): mixed { - return $this->lazyObjectReal->_unpack(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_unpack(...\func_get_args()); } public function _prefix($key): bool|string { - return $this->lazyObjectReal->_prefix(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_prefix(...\func_get_args()); } public function _masters(): array { - return $this->lazyObjectReal->_masters(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_masters(...\func_get_args()); } public function _redir(): ?string { - return $this->lazyObjectReal->_redir(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->_redir(...\func_get_args()); } public function acl($key_or_address, $subcmd, ...$args): mixed { - return $this->lazyObjectReal->acl(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->acl(...\func_get_args()); } public function append($key, $value): \RedisCluster|bool|int { - return $this->lazyObjectReal->append(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->append(...\func_get_args()); } public function bgrewriteaof($key_or_address): \RedisCluster|bool { - return $this->lazyObjectReal->bgrewriteaof(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bgrewriteaof(...\func_get_args()); } public function bgsave($key_or_address): \RedisCluster|bool { - return $this->lazyObjectReal->bgsave(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bgsave(...\func_get_args()); } public function bitcount($key, $start = 0, $end = -1, $bybit = false): \RedisCluster|bool|int { - return $this->lazyObjectReal->bitcount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bitcount(...\func_get_args()); } public function bitop($operation, $deskey, $srckey, ...$otherkeys): \RedisCluster|bool|int { - return $this->lazyObjectReal->bitop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bitop(...\func_get_args()); } public function bitpos($key, $bit, $start = 0, $end = -1, $bybit = false): \RedisCluster|false|int { - return $this->lazyObjectReal->bitpos(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bitpos(...\func_get_args()); } public function blpop($key, $timeout_or_key, ...$extra_args): \RedisCluster|array|false|null { - return $this->lazyObjectReal->blpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->blpop(...\func_get_args()); } public function brpop($key, $timeout_or_key, ...$extra_args): \RedisCluster|array|false|null { - return $this->lazyObjectReal->brpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->brpop(...\func_get_args()); } public function brpoplpush($srckey, $deskey, $timeout): mixed { - return $this->lazyObjectReal->brpoplpush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->brpoplpush(...\func_get_args()); } public function lmove($src, $dst, $wherefrom, $whereto): \Redis|false|string { - return $this->lazyObjectReal->lmove(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lmove(...\func_get_args()); } public function blmove($src, $dst, $wherefrom, $whereto, $timeout): \Redis|false|string { - return $this->lazyObjectReal->blmove(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->blmove(...\func_get_args()); } public function bzpopmax($key, $timeout_or_key, ...$extra_args): array { - return $this->lazyObjectReal->bzpopmax(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bzpopmax(...\func_get_args()); } public function bzpopmin($key, $timeout_or_key, ...$extra_args): array { - return $this->lazyObjectReal->bzpopmin(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bzpopmin(...\func_get_args()); } public function bzmpop($timeout, $keys, $from, $count = 1): \RedisCluster|array|false|null { - return $this->lazyObjectReal->bzmpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->bzmpop(...\func_get_args()); } public function zmpop($keys, $from, $count = 1): \RedisCluster|array|false|null { - return $this->lazyObjectReal->zmpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zmpop(...\func_get_args()); } public function blmpop($timeout, $keys, $from, $count = 1): \RedisCluster|array|false|null { - return $this->lazyObjectReal->blmpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->blmpop(...\func_get_args()); } public function lmpop($keys, $from, $count = 1): \RedisCluster|array|false|null { - return $this->lazyObjectReal->lmpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lmpop(...\func_get_args()); } public function clearlasterror(): bool { - return $this->lazyObjectReal->clearlasterror(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->clearlasterror(...\func_get_args()); } public function client($key_or_address, $subcommand, $arg = null): array|bool|string { - return $this->lazyObjectReal->client(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->client(...\func_get_args()); } public function close(): bool { - return $this->lazyObjectReal->close(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->close(...\func_get_args()); } public function cluster($key_or_address, $command, ...$extra_args): mixed { - return $this->lazyObjectReal->cluster(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->cluster(...\func_get_args()); } public function command(...$extra_args): mixed { - return $this->lazyObjectReal->command(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->command(...\func_get_args()); } public function config($key_or_address, $subcommand, ...$extra_args): mixed { - return $this->lazyObjectReal->config(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->config(...\func_get_args()); } public function dbsize($key_or_address): \RedisCluster|int { - return $this->lazyObjectReal->dbsize(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->dbsize(...\func_get_args()); } public function copy($src, $dst, $options = null): \RedisCluster|bool { - return $this->lazyObjectReal->copy(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->copy(...\func_get_args()); } public function decr($key, $by = 1): \RedisCluster|false|int { - return $this->lazyObjectReal->decr(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->decr(...\func_get_args()); } public function decrby($key, $value): \RedisCluster|false|int { - return $this->lazyObjectReal->decrby(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->decrby(...\func_get_args()); } public function decrbyfloat($key, $value): float { - return $this->lazyObjectReal->decrbyfloat(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->decrbyfloat(...\func_get_args()); } public function del($key, ...$other_keys): \RedisCluster|false|int { - return $this->lazyObjectReal->del(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->del(...\func_get_args()); } public function discard(): bool { - return $this->lazyObjectReal->discard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->discard(...\func_get_args()); } public function dump($key): \RedisCluster|false|string { - return $this->lazyObjectReal->dump(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->dump(...\func_get_args()); } public function echo($key_or_address, $msg): \RedisCluster|false|string { - return $this->lazyObjectReal->echo(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->echo(...\func_get_args()); } public function eval($script, $args = [], $num_keys = 0): mixed { - return $this->lazyObjectReal->eval(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->eval(...\func_get_args()); } public function eval_ro($script, $args = [], $num_keys = 0): mixed { - return $this->lazyObjectReal->eval_ro(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->eval_ro(...\func_get_args()); } public function evalsha($script_sha, $args = [], $num_keys = 0): mixed { - return $this->lazyObjectReal->evalsha(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->evalsha(...\func_get_args()); } public function evalsha_ro($script_sha, $args = [], $num_keys = 0): mixed { - return $this->lazyObjectReal->evalsha_ro(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->evalsha_ro(...\func_get_args()); } public function exec(): array|false { - return $this->lazyObjectReal->exec(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->exec(...\func_get_args()); } public function exists($key, ...$other_keys): \RedisCluster|bool|int { - return $this->lazyObjectReal->exists(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->exists(...\func_get_args()); } public function touch($key, ...$other_keys): \RedisCluster|bool|int { - return $this->lazyObjectReal->touch(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->touch(...\func_get_args()); } public function expire($key, $timeout, $mode = null): \RedisCluster|bool { - return $this->lazyObjectReal->expire(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->expire(...\func_get_args()); } public function expireat($key, $timestamp, $mode = null): \RedisCluster|bool { - return $this->lazyObjectReal->expireat(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->expireat(...\func_get_args()); } public function expiretime($key): \RedisCluster|false|int { - return $this->lazyObjectReal->expiretime(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->expiretime(...\func_get_args()); } public function pexpiretime($key): \RedisCluster|false|int { - return $this->lazyObjectReal->pexpiretime(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pexpiretime(...\func_get_args()); } public function flushall($key_or_address, $async = false): \RedisCluster|bool { - return $this->lazyObjectReal->flushall(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->flushall(...\func_get_args()); } public function flushdb($key_or_address, $async = false): \RedisCluster|bool { - return $this->lazyObjectReal->flushdb(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->flushdb(...\func_get_args()); } public function geoadd($key, $lng, $lat, $member, ...$other_triples_and_options): \RedisCluster|false|int { - return $this->lazyObjectReal->geoadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geoadd(...\func_get_args()); } public function geodist($key, $src, $dest, $unit = null): \RedisCluster|false|float { - return $this->lazyObjectReal->geodist(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geodist(...\func_get_args()); } public function geohash($key, $member, ...$other_members): \RedisCluster|array|false { - return $this->lazyObjectReal->geohash(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geohash(...\func_get_args()); } public function geopos($key, $member, ...$other_members): \RedisCluster|array|false { - return $this->lazyObjectReal->geopos(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geopos(...\func_get_args()); } public function georadius($key, $lng, $lat, $radius, $unit, $options = []): mixed { - return $this->lazyObjectReal->georadius(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadius(...\func_get_args()); } public function georadius_ro($key, $lng, $lat, $radius, $unit, $options = []): mixed { - return $this->lazyObjectReal->georadius_ro(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadius_ro(...\func_get_args()); } public function georadiusbymember($key, $member, $radius, $unit, $options = []): mixed { - return $this->lazyObjectReal->georadiusbymember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadiusbymember(...\func_get_args()); } public function georadiusbymember_ro($key, $member, $radius, $unit, $options = []): mixed { - return $this->lazyObjectReal->georadiusbymember_ro(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->georadiusbymember_ro(...\func_get_args()); } public function geosearch($key, $position, $shape, $unit, $options = []): \RedisCluster|array { - return $this->lazyObjectReal->geosearch(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geosearch(...\func_get_args()); } public function geosearchstore($dst, $src, $position, $shape, $unit, $options = []): \RedisCluster|array|false|int { - return $this->lazyObjectReal->geosearchstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->geosearchstore(...\func_get_args()); } public function get($key): mixed { - return $this->lazyObjectReal->get(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->get(...\func_get_args()); } public function getbit($key, $value): \RedisCluster|false|int { - return $this->lazyObjectReal->getbit(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getbit(...\func_get_args()); } public function getlasterror(): ?string { - return $this->lazyObjectReal->getlasterror(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getlasterror(...\func_get_args()); } public function getmode(): int { - return $this->lazyObjectReal->getmode(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getmode(...\func_get_args()); } public function getoption($option): mixed { - return $this->lazyObjectReal->getoption(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getoption(...\func_get_args()); } public function getrange($key, $start, $end): \RedisCluster|false|string { - return $this->lazyObjectReal->getrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getrange(...\func_get_args()); } public function lcs($key1, $key2, $options = null): \RedisCluster|array|false|int|string { - return $this->lazyObjectReal->lcs(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lcs(...\func_get_args()); } public function getset($key, $value): \RedisCluster|bool|string { - return $this->lazyObjectReal->getset(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->getset(...\func_get_args()); } public function gettransferredbytes(): array|false { - return $this->lazyObjectReal->gettransferredbytes(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->gettransferredbytes(...\func_get_args()); } public function cleartransferredbytes(): void { - $this->lazyObjectReal->cleartransferredbytes(...\func_get_args()); + ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->cleartransferredbytes(...\func_get_args()); } public function hdel($key, $member, ...$other_members): \RedisCluster|false|int { - return $this->lazyObjectReal->hdel(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hdel(...\func_get_args()); } public function hexists($key, $member): \RedisCluster|bool { - return $this->lazyObjectReal->hexists(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hexists(...\func_get_args()); } public function hget($key, $member): mixed { - return $this->lazyObjectReal->hget(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hget(...\func_get_args()); } public function hgetall($key): \RedisCluster|array|false { - return $this->lazyObjectReal->hgetall(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hgetall(...\func_get_args()); } public function hincrby($key, $member, $value): \RedisCluster|false|int { - return $this->lazyObjectReal->hincrby(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hincrby(...\func_get_args()); } public function hincrbyfloat($key, $member, $value): \RedisCluster|false|float { - return $this->lazyObjectReal->hincrbyfloat(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hincrbyfloat(...\func_get_args()); } public function hkeys($key): \RedisCluster|array|false { - return $this->lazyObjectReal->hkeys(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hkeys(...\func_get_args()); } public function hlen($key): \RedisCluster|false|int { - return $this->lazyObjectReal->hlen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hlen(...\func_get_args()); } public function hmget($key, $keys): \RedisCluster|array|false { - return $this->lazyObjectReal->hmget(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hmget(...\func_get_args()); } public function hmset($key, $key_values): \RedisCluster|bool { - return $this->lazyObjectReal->hmset(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hmset(...\func_get_args()); } public function hscan($key, &$iterator, $pattern = null, $count = 0): array|bool { - return $this->lazyObjectReal->hscan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hscan($key, $iterator, $pattern, $count, ...\array_slice(\func_get_args(), 4)); } public function hrandfield($key, $options = null): \RedisCluster|array|string { - return $this->lazyObjectReal->hrandfield(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hrandfield(...\func_get_args()); } public function hset($key, $member, $value): \RedisCluster|false|int { - return $this->lazyObjectReal->hset(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hset(...\func_get_args()); } public function hsetnx($key, $member, $value): \RedisCluster|bool { - return $this->lazyObjectReal->hsetnx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hsetnx(...\func_get_args()); } public function hstrlen($key, $field): \RedisCluster|false|int { - return $this->lazyObjectReal->hstrlen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hstrlen(...\func_get_args()); } public function hvals($key): \RedisCluster|array|false { - return $this->lazyObjectReal->hvals(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hvals(...\func_get_args()); } public function incr($key, $by = 1): \RedisCluster|false|int { - return $this->lazyObjectReal->incr(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->incr(...\func_get_args()); } public function incrby($key, $value): \RedisCluster|false|int { - return $this->lazyObjectReal->incrby(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->incrby(...\func_get_args()); } public function incrbyfloat($key, $value): \RedisCluster|false|float { - return $this->lazyObjectReal->incrbyfloat(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->incrbyfloat(...\func_get_args()); } public function info($key_or_address, ...$sections): \RedisCluster|array|false { - return $this->lazyObjectReal->info(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->info(...\func_get_args()); } public function keys($pattern): \RedisCluster|array|false { - return $this->lazyObjectReal->keys(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->keys(...\func_get_args()); } public function lastsave($key_or_address): \RedisCluster|false|int { - return $this->lazyObjectReal->lastsave(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lastsave(...\func_get_args()); } public function lget($key, $index): \RedisCluster|bool|string { - return $this->lazyObjectReal->lget(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lget(...\func_get_args()); } public function lindex($key, $index): mixed { - return $this->lazyObjectReal->lindex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lindex(...\func_get_args()); } public function linsert($key, $pos, $pivot, $value): \RedisCluster|false|int { - return $this->lazyObjectReal->linsert(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->linsert(...\func_get_args()); } public function llen($key): \RedisCluster|bool|int { - return $this->lazyObjectReal->llen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->llen(...\func_get_args()); } public function lpop($key, $count = 0): \RedisCluster|array|bool|string { - return $this->lazyObjectReal->lpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lpop(...\func_get_args()); } public function lpos($key, $value, $options = null): \Redis|array|bool|int|null { - return $this->lazyObjectReal->lpos(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lpos(...\func_get_args()); } public function lpush($key, $value, ...$other_values): \RedisCluster|bool|int { - return $this->lazyObjectReal->lpush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lpush(...\func_get_args()); } public function lpushx($key, $value): \RedisCluster|bool|int { - return $this->lazyObjectReal->lpushx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lpushx(...\func_get_args()); } public function lrange($key, $start, $end): \RedisCluster|array|false { - return $this->lazyObjectReal->lrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lrange(...\func_get_args()); } public function lrem($key, $value, $count = 0): \RedisCluster|bool|int { - return $this->lazyObjectReal->lrem(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lrem(...\func_get_args()); } public function lset($key, $index, $value): \RedisCluster|bool { - return $this->lazyObjectReal->lset(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->lset(...\func_get_args()); } public function ltrim($key, $start, $end): \RedisCluster|bool { - return $this->lazyObjectReal->ltrim(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->ltrim(...\func_get_args()); } public function mget($keys): \RedisCluster|array|false { - return $this->lazyObjectReal->mget(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->mget(...\func_get_args()); } public function mset($key_values): \RedisCluster|bool { - return $this->lazyObjectReal->mset(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->mset(...\func_get_args()); } public function msetnx($key_values): \RedisCluster|array|false { - return $this->lazyObjectReal->msetnx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->msetnx(...\func_get_args()); } public function multi($value = \Redis::MULTI): \RedisCluster|bool { - return $this->lazyObjectReal->multi(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->multi(...\func_get_args()); } public function object($subcommand, $key): \RedisCluster|false|int|string { - return $this->lazyObjectReal->object(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->object(...\func_get_args()); } public function persist($key): \RedisCluster|bool { - return $this->lazyObjectReal->persist(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->persist(...\func_get_args()); } public function pexpire($key, $timeout, $mode = null): \RedisCluster|bool { - return $this->lazyObjectReal->pexpire(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pexpire(...\func_get_args()); } public function pexpireat($key, $timestamp, $mode = null): \RedisCluster|bool { - return $this->lazyObjectReal->pexpireat(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pexpireat(...\func_get_args()); } public function pfadd($key, $elements): \RedisCluster|bool { - return $this->lazyObjectReal->pfadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pfadd(...\func_get_args()); } public function pfcount($key): \RedisCluster|false|int { - return $this->lazyObjectReal->pfcount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pfcount(...\func_get_args()); } public function pfmerge($key, $keys): \RedisCluster|bool { - return $this->lazyObjectReal->pfmerge(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pfmerge(...\func_get_args()); } public function ping($key_or_address, $message = null): mixed { - return $this->lazyObjectReal->ping(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->ping(...\func_get_args()); } public function psetex($key, $timeout, $value): \RedisCluster|bool { - return $this->lazyObjectReal->psetex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->psetex(...\func_get_args()); } public function psubscribe($patterns, $callback): void { - $this->lazyObjectReal->psubscribe(...\func_get_args()); + ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->psubscribe(...\func_get_args()); } public function pttl($key): \RedisCluster|false|int { - return $this->lazyObjectReal->pttl(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pttl(...\func_get_args()); } public function publish($channel, $message): \RedisCluster|bool { - return $this->lazyObjectReal->publish(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->publish(...\func_get_args()); } public function pubsub($key_or_address, ...$values): mixed { - return $this->lazyObjectReal->pubsub(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->pubsub(...\func_get_args()); } public function punsubscribe($pattern, ...$other_patterns): array|bool { - return $this->lazyObjectReal->punsubscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->punsubscribe(...\func_get_args()); } public function randomkey($key_or_address): \RedisCluster|bool|string { - return $this->lazyObjectReal->randomkey(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->randomkey(...\func_get_args()); } public function rawcommand($key_or_address, $command, ...$args): mixed { - return $this->lazyObjectReal->rawcommand(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rawcommand(...\func_get_args()); } public function rename($key_src, $key_dst): \RedisCluster|bool { - return $this->lazyObjectReal->rename(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rename(...\func_get_args()); } public function renamenx($key, $newkey): \RedisCluster|bool { - return $this->lazyObjectReal->renamenx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->renamenx(...\func_get_args()); } public function restore($key, $timeout, $value, $options = null): \RedisCluster|bool { - return $this->lazyObjectReal->restore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->restore(...\func_get_args()); } public function role($key_or_address): mixed { - return $this->lazyObjectReal->role(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->role(...\func_get_args()); } public function rpop($key, $count = 0): \RedisCluster|array|bool|string { - return $this->lazyObjectReal->rpop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rpop(...\func_get_args()); } public function rpoplpush($src, $dst): \RedisCluster|bool|string { - return $this->lazyObjectReal->rpoplpush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rpoplpush(...\func_get_args()); } public function rpush($key, ...$elements): \RedisCluster|false|int { - return $this->lazyObjectReal->rpush(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rpush(...\func_get_args()); } public function rpushx($key, $value): \RedisCluster|bool|int { - return $this->lazyObjectReal->rpushx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rpushx(...\func_get_args()); } public function sadd($key, $value, ...$other_values): \RedisCluster|false|int { - return $this->lazyObjectReal->sadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sadd(...\func_get_args()); } public function saddarray($key, $values): \RedisCluster|bool|int { - return $this->lazyObjectReal->saddarray(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->saddarray(...\func_get_args()); } public function save($key_or_address): \RedisCluster|bool { - return $this->lazyObjectReal->save(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->save(...\func_get_args()); } public function scan(&$iterator, $key_or_address, $pattern = null, $count = 0): array|bool { - return $this->lazyObjectReal->scan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->scan($iterator, $key_or_address, $pattern, $count, ...\array_slice(\func_get_args(), 4)); } public function scard($key): \RedisCluster|false|int { - return $this->lazyObjectReal->scard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->scard(...\func_get_args()); } public function script($key_or_address, ...$args): mixed { - return $this->lazyObjectReal->script(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->script(...\func_get_args()); } public function sdiff($key, ...$other_keys): \RedisCluster|array|false { - return $this->lazyObjectReal->sdiff(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sdiff(...\func_get_args()); } public function sdiffstore($dst, $key, ...$other_keys): \RedisCluster|false|int { - return $this->lazyObjectReal->sdiffstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sdiffstore(...\func_get_args()); } public function set($key, $value, $options = null): \RedisCluster|bool|string { - return $this->lazyObjectReal->set(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->set(...\func_get_args()); } public function setbit($key, $offset, $onoff): \RedisCluster|false|int { - return $this->lazyObjectReal->setbit(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setbit(...\func_get_args()); } public function setex($key, $expire, $value): \RedisCluster|bool { - return $this->lazyObjectReal->setex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setex(...\func_get_args()); } public function setnx($key, $value): \RedisCluster|bool { - return $this->lazyObjectReal->setnx(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setnx(...\func_get_args()); } public function setoption($option, $value): bool { - return $this->lazyObjectReal->setoption(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setoption(...\func_get_args()); } public function setrange($key, $offset, $value): \RedisCluster|false|int { - return $this->lazyObjectReal->setrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->setrange(...\func_get_args()); } public function sinter($key, ...$other_keys): \RedisCluster|array|false { - return $this->lazyObjectReal->sinter(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sinter(...\func_get_args()); } public function sintercard($keys, $limit = -1): \RedisCluster|false|int { - return $this->lazyObjectReal->sintercard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sintercard(...\func_get_args()); } public function sinterstore($key, ...$other_keys): \RedisCluster|false|int { - return $this->lazyObjectReal->sinterstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sinterstore(...\func_get_args()); } public function sismember($key, $value): \RedisCluster|bool { - return $this->lazyObjectReal->sismember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sismember(...\func_get_args()); } public function smismember($key, $member, ...$other_members): \RedisCluster|array|false { - return $this->lazyObjectReal->smismember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->smismember(...\func_get_args()); } public function slowlog($key_or_address, ...$args): mixed { - return $this->lazyObjectReal->slowlog(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->slowlog(...\func_get_args()); } public function smembers($key): \RedisCluster|array|false { - return $this->lazyObjectReal->smembers(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->smembers(...\func_get_args()); } public function smove($src, $dst, $member): \RedisCluster|bool { - return $this->lazyObjectReal->smove(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->smove(...\func_get_args()); } public function sort($key, $options = null): \RedisCluster|array|bool|int|string { - return $this->lazyObjectReal->sort(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sort(...\func_get_args()); } public function sort_ro($key, $options = null): \RedisCluster|array|bool|int|string { - return $this->lazyObjectReal->sort_ro(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sort_ro(...\func_get_args()); } public function spop($key, $count = 0): \RedisCluster|array|false|string { - return $this->lazyObjectReal->spop(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->spop(...\func_get_args()); } public function srandmember($key, $count = 0): \RedisCluster|array|false|string { - return $this->lazyObjectReal->srandmember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->srandmember(...\func_get_args()); } public function srem($key, $value, ...$other_values): \RedisCluster|false|int { - return $this->lazyObjectReal->srem(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->srem(...\func_get_args()); } public function sscan($key, &$iterator, $pattern = null, $count = 0): array|false { - return $this->lazyObjectReal->sscan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sscan($key, $iterator, $pattern, $count, ...\array_slice(\func_get_args(), 4)); } public function strlen($key): \RedisCluster|false|int { - return $this->lazyObjectReal->strlen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->strlen(...\func_get_args()); } public function subscribe($channels, $cb): void { - $this->lazyObjectReal->subscribe(...\func_get_args()); + ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->subscribe(...\func_get_args()); } public function sunion($key, ...$other_keys): \RedisCluster|array|bool { - return $this->lazyObjectReal->sunion(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sunion(...\func_get_args()); } public function sunionstore($dst, $key, ...$other_keys): \RedisCluster|false|int { - return $this->lazyObjectReal->sunionstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->sunionstore(...\func_get_args()); } public function time($key_or_address): \RedisCluster|array|bool { - return $this->lazyObjectReal->time(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->time(...\func_get_args()); } public function ttl($key): \RedisCluster|false|int { - return $this->lazyObjectReal->ttl(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->ttl(...\func_get_args()); } public function type($key): \RedisCluster|false|int { - return $this->lazyObjectReal->type(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->type(...\func_get_args()); } public function unsubscribe($channels): array|bool { - return $this->lazyObjectReal->unsubscribe(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->unsubscribe(...\func_get_args()); } public function unlink($key, ...$other_keys): \RedisCluster|false|int { - return $this->lazyObjectReal->unlink(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->unlink(...\func_get_args()); } public function unwatch(): bool { - return $this->lazyObjectReal->unwatch(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->unwatch(...\func_get_args()); } public function watch($key, ...$other_keys): \RedisCluster|bool { - return $this->lazyObjectReal->watch(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->watch(...\func_get_args()); } public function xack($key, $group, $ids): \RedisCluster|false|int { - return $this->lazyObjectReal->xack(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xack(...\func_get_args()); } public function xadd($key, $id, $values, $maxlen = 0, $approx = false): \RedisCluster|false|string { - return $this->lazyObjectReal->xadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xadd(...\func_get_args()); } public function xclaim($key, $group, $consumer, $min_iddle, $ids, $options): \RedisCluster|array|false|string { - return $this->lazyObjectReal->xclaim(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xclaim(...\func_get_args()); } public function xdel($key, $ids): \RedisCluster|false|int { - return $this->lazyObjectReal->xdel(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xdel(...\func_get_args()); } public function xgroup($operation, $key = null, $group = null, $id_or_consumer = null, $mkstream = false, $entries_read = -2): mixed { - return $this->lazyObjectReal->xgroup(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xgroup(...\func_get_args()); } public function xautoclaim($key, $group, $consumer, $min_idle, $start, $count = -1, $justid = false): \RedisCluster|array|bool { - return $this->lazyObjectReal->xautoclaim(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xautoclaim(...\func_get_args()); } public function xinfo($operation, $arg1 = null, $arg2 = null, $count = -1): mixed { - return $this->lazyObjectReal->xinfo(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xinfo(...\func_get_args()); } public function xlen($key): \RedisCluster|false|int { - return $this->lazyObjectReal->xlen(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xlen(...\func_get_args()); } public function xpending($key, $group, $start = null, $end = null, $count = -1, $consumer = null): \RedisCluster|array|false { - return $this->lazyObjectReal->xpending(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xpending(...\func_get_args()); } public function xrange($key, $start, $end, $count = -1): \RedisCluster|array|bool { - return $this->lazyObjectReal->xrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xrange(...\func_get_args()); } public function xread($streams, $count = -1, $block = -1): \RedisCluster|array|bool { - return $this->lazyObjectReal->xread(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xread(...\func_get_args()); } public function xreadgroup($group, $consumer, $streams, $count = 1, $block = 1): \RedisCluster|array|bool { - return $this->lazyObjectReal->xreadgroup(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xreadgroup(...\func_get_args()); } public function xrevrange($key, $start, $end, $count = -1): \RedisCluster|array|bool { - return $this->lazyObjectReal->xrevrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xrevrange(...\func_get_args()); } public function xtrim($key, $maxlen, $approx = false, $minid = false, $limit = -1): \RedisCluster|false|int { - return $this->lazyObjectReal->xtrim(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->xtrim(...\func_get_args()); } - public function zadd($key, $score_or_options, ...$more_scores_and_mems): \RedisCluster|false|int + public function zadd($key, $score_or_options, ...$more_scores_and_mems): \RedisCluster|false|float|int { - return $this->lazyObjectReal->zadd(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zadd(...\func_get_args()); } public function zcard($key): \RedisCluster|false|int { - return $this->lazyObjectReal->zcard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zcard(...\func_get_args()); } public function zcount($key, $start, $end): \RedisCluster|false|int { - return $this->lazyObjectReal->zcount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zcount(...\func_get_args()); } public function zincrby($key, $value, $member): \RedisCluster|false|float { - return $this->lazyObjectReal->zincrby(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zincrby(...\func_get_args()); } public function zinterstore($dst, $keys, $weights = null, $aggregate = null): \RedisCluster|false|int { - return $this->lazyObjectReal->zinterstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zinterstore(...\func_get_args()); } public function zintercard($keys, $limit = -1): \RedisCluster|false|int { - return $this->lazyObjectReal->zintercard(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zintercard(...\func_get_args()); } public function zlexcount($key, $min, $max): \RedisCluster|false|int { - return $this->lazyObjectReal->zlexcount(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zlexcount(...\func_get_args()); } public function zpopmax($key, $value = null): \RedisCluster|array|bool { - return $this->lazyObjectReal->zpopmax(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zpopmax(...\func_get_args()); } public function zpopmin($key, $value = null): \RedisCluster|array|bool { - return $this->lazyObjectReal->zpopmin(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zpopmin(...\func_get_args()); } public function zrange($key, $start, $end, $options = null): \RedisCluster|array|bool { - return $this->lazyObjectReal->zrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrange(...\func_get_args()); } public function zrangestore($dstkey, $srckey, $start, $end, $options = null): \RedisCluster|false|int { - return $this->lazyObjectReal->zrangestore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrangestore(...\func_get_args()); } public function zrandmember($key, $options = null): \RedisCluster|array|string { - return $this->lazyObjectReal->zrandmember(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrandmember(...\func_get_args()); } public function zrangebylex($key, $min, $max, $offset = -1, $count = -1): \RedisCluster|array|false { - return $this->lazyObjectReal->zrangebylex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrangebylex(...\func_get_args()); } public function zrangebyscore($key, $start, $end, $options = []): \RedisCluster|array|false { - return $this->lazyObjectReal->zrangebyscore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrangebyscore(...\func_get_args()); } public function zrank($key, $member): \RedisCluster|false|int { - return $this->lazyObjectReal->zrank(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrank(...\func_get_args()); } public function zrem($key, $value, ...$other_values): \RedisCluster|false|int { - return $this->lazyObjectReal->zrem(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrem(...\func_get_args()); } public function zremrangebylex($key, $min, $max): \RedisCluster|false|int { - return $this->lazyObjectReal->zremrangebylex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zremrangebylex(...\func_get_args()); } public function zremrangebyrank($key, $min, $max): \RedisCluster|false|int { - return $this->lazyObjectReal->zremrangebyrank(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zremrangebyrank(...\func_get_args()); } public function zremrangebyscore($key, $min, $max): \RedisCluster|false|int { - return $this->lazyObjectReal->zremrangebyscore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zremrangebyscore(...\func_get_args()); } public function zrevrange($key, $min, $max, $options = null): \RedisCluster|array|bool { - return $this->lazyObjectReal->zrevrange(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrevrange(...\func_get_args()); } public function zrevrangebylex($key, $min, $max, $options = null): \RedisCluster|array|bool { - return $this->lazyObjectReal->zrevrangebylex(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrevrangebylex(...\func_get_args()); } public function zrevrangebyscore($key, $min, $max, $options = null): \RedisCluster|array|bool { - return $this->lazyObjectReal->zrevrangebyscore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrevrangebyscore(...\func_get_args()); } public function zrevrank($key, $member): \RedisCluster|false|int { - return $this->lazyObjectReal->zrevrank(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zrevrank(...\func_get_args()); } public function zscan($key, &$iterator, $pattern = null, $count = 0): \RedisCluster|array|bool { - return $this->lazyObjectReal->zscan(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zscan($key, $iterator, $pattern, $count, ...\array_slice(\func_get_args(), 4)); } public function zscore($key, $member): \RedisCluster|false|float { - return $this->lazyObjectReal->zscore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zscore(...\func_get_args()); } public function zmscore($key, $member, ...$other_members): \Redis|array|false { - return $this->lazyObjectReal->zmscore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zmscore(...\func_get_args()); } public function zunionstore($dst, $keys, $weights = null, $aggregate = null): \RedisCluster|false|int { - return $this->lazyObjectReal->zunionstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zunionstore(...\func_get_args()); } public function zinter($keys, $weights = null, $options = null): \RedisCluster|array|false { - return $this->lazyObjectReal->zinter(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zinter(...\func_get_args()); } public function zdiffstore($dst, $keys): \RedisCluster|false|int { - return $this->lazyObjectReal->zdiffstore(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zdiffstore(...\func_get_args()); } public function zunion($keys, $weights = null, $options = null): \RedisCluster|array|false { - return $this->lazyObjectReal->zunion(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zunion(...\func_get_args()); } public function zdiff($keys, $options = null): \RedisCluster|array|false { - return $this->lazyObjectReal->zdiff(...\func_get_args()); + return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->zdiff(...\func_get_args()); } } diff --git a/Traits/RedisTrait.php b/Traits/RedisTrait.php index eecf9685..4721f0a4 100644 --- a/Traits/RedisTrait.php +++ b/Traits/RedisTrait.php @@ -144,8 +144,8 @@ public static function createConnection(string $dsn, array $options = []): \Redi if (isset($params['host']) || isset($params['path'])) { if (!isset($params['dbindex']) && isset($params['path'])) { - if (preg_match('#/(\d+)$#', $params['path'], $m)) { - $params['dbindex'] = $m[1]; + if (preg_match('#/(\d+)?$#', $params['path'], $m)) { + $params['dbindex'] = $m[1] ?? '0'; $params['path'] = substr($params['path'], 0, -\strlen($m[0])); } elseif (isset($params['host'])) { throw new InvalidArgumentException(sprintf('Invalid Redis DSN: "%s", the "dbindex" parameter must be a number.', $dsn)); @@ -330,6 +330,13 @@ public static function createConnection(string $dsn, array $options = []): \Redi $params['parameters']['password'] = $auth; } } + + if (isset($params['ssl'])) { + foreach ($hosts as $i => $host) { + $hosts[$i]['ssl'] ??= $params['ssl']; + } + } + if (1 === \count($hosts) && !($params['redis_cluster'] || $params['redis_sentinel'])) { $hosts = $hosts[0]; } elseif (\in_array($params['failover'], ['slaves', 'distribute'], true) && !isset($params['replication'])) { @@ -338,7 +345,7 @@ public static function createConnection(string $dsn, array $options = []): \Redi } $params['exceptions'] = false; - $redis = new $class($hosts, array_diff_key($params, array_diff_key(self::$defaultConnectionOptions, ['ssl' => null]))); + $redis = new $class($hosts, array_diff_key($params, self::$defaultConnectionOptions)); if (isset($params['redis_sentinel'])) { $redis->getConnection()->setSentinelTimeout($params['timeout']); } diff --git a/composer.json b/composer.json index 8a11d7e4..0ab0ec3a 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "psr/log": "^1.1|^2|^3", "symfony/cache-contracts": "^1.1.7|^2|^3", "symfony/service-contracts": "^1.1|^2|^3", - "symfony/var-exporter": "^6.2" + "symfony/var-exporter": "^6.2.10" }, "require-dev": { "cache/integration-tests": "dev-master",