Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function testRelayClusterProxy()
$expectedMethods = [];

foreach ((new \ReflectionClass(RelayClusterProxy::class))->getMethods() as $method) {
if ('reset' === $method->name || method_exists(RedisProxyTrait::class, $method->name) || $method->isStatic()) {
if ('reset' === $method->name || method_exists(RedisProxyTrait::class, $method->name) || $method->isInternal()) {
continue;
}

Expand Down
87 changes: 87 additions & 0 deletions src/Symfony/Component/Cache/Traits/Relay/RelayCluster11Trait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\Cache\Traits\Relay;

if (version_compare(phpversion('relay'), '0.11.0', '>=')) {
/**
* @internal
*/
trait RelayCluster11Trait
{
public function flushSlotCache(): bool
{
return $this->initializeLazyObject()->flushSlotCache(...\func_get_args());
}

public function fullscan($match = null, $count = 0, $type = null): \Generator|false
{
return $this->initializeLazyObject()->fullscan(...\func_get_args());
}

public function getdel($key): mixed
{
return $this->initializeLazyObject()->getdel(...\func_get_args());
}

public function hexpire($hash, $ttl, $fields, $mode = null): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->hexpire(...\func_get_args());
}

public function hexpireat($hash, $ttl, $fields, $mode = null): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->hexpireat(...\func_get_args());
}

public function hexpiretime($hash, $fields): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->hexpiretime(...\func_get_args());
}

public function hpersist($hash, $fields): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->hpersist(...\func_get_args());
}

public function hpexpire($hash, $ttl, $fields, $mode = null): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->hpexpire(...\func_get_args());
}

public function hpexpireat($hash, $ttl, $fields, $mode = null): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->hpexpireat(...\func_get_args());
}

public function hpexpiretime($hash, $fields): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->hpexpiretime(...\func_get_args());
}

public function hpttl($hash, $fields): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->hpttl(...\func_get_args());
}

public function httl($hash, $fields): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->httl(...\func_get_args());
}
}
} else {
/**
* @internal
*/
trait RelayCluster11Trait

Check failure on line 84 in src/Symfony/Component/Cache/Traits/Relay/RelayCluster11Trait.php

View workflow job for this annotation

GitHub Actions / Psalm

DuplicateClass

src/Symfony/Component/Cache/Traits/Relay/RelayCluster11Trait.php:84:11: DuplicateClass: Class Symfony\Component\Cache\Traits\Relay\RelayCluster11Trait has already been defined in /home/runner/work/symfony/symfony/src/Symfony/Component/Cache/Traits/Relay/RelayCluster11Trait.php (see https://psalm.dev/071)

Check failure on line 84 in src/Symfony/Component/Cache/Traits/Relay/RelayCluster11Trait.php

View workflow job for this annotation

GitHub Actions / Psalm

DuplicateClass

src/Symfony/Component/Cache/Traits/Relay/RelayCluster11Trait.php:84:11: DuplicateClass: Class Symfony\Component\Cache\Traits\Relay\RelayCluster11Trait has already been defined in /home/runner/work/symfony/symfony/src/Symfony/Component/Cache/Traits/Relay/RelayCluster11Trait.php (see https://psalm.dev/071)
{
}
}
131 changes: 131 additions & 0 deletions src/Symfony/Component/Cache/Traits/Relay/RelayCluster12Trait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\Cache\Traits\Relay;

if (version_compare(phpversion('relay'), '0.12.0', '>=')) {
/**
* @internal
*/
trait RelayCluster12Trait
{
public function delifeq($key, $value): \Relay\Cluster|false|int
{
return $this->initializeLazyObject()->delifeq(...\func_get_args());
}

public function hgetdel($key, $fields): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->hgetdel(...\func_get_args());
}

public function hgetex($hash, $fields, $expiry = null): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->hgetex(...\func_get_args());
}

public function hsetex($key, $fields, $expiry = null): \Relay\Cluster|false|int
{
return $this->initializeLazyObject()->hsetex(...\func_get_args());
}

public function vadd($key, $values, $element, $options = null): \Relay\Cluster|false|int
{
return $this->initializeLazyObject()->vadd(...\func_get_args());
}

public function vcard($key): \Relay\Cluster|false|int
{
return $this->initializeLazyObject()->vcard(...\func_get_args());
}

public function vdim($key): \Relay\Cluster|false|int
{
return $this->initializeLazyObject()->vdim(...\func_get_args());
}

public function vemb($key, $element, $raw = false): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->vemb(...\func_get_args());
}

public function vgetattr($key, $element, $raw = false): \Relay\Cluster|array|false|string
{
return $this->initializeLazyObject()->vgetattr(...\func_get_args());
}

public function vinfo($key): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->vinfo(...\func_get_args());
}

public function vismember($key, $element): \Relay\Cluster|bool
{
return $this->initializeLazyObject()->vismember(...\func_get_args());
}

public function vlinks($key, $element, $withscores): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->vlinks(...\func_get_args());
}

public function vrandmember($key, $count = 0): \Relay\Cluster|array|false|string
{
return $this->initializeLazyObject()->vrandmember(...\func_get_args());
}

public function vrange($key, $end, $start, $count = -1): \Relay\Cluster|array|bool
{
return $this->initializeLazyObject()->vrange(...\func_get_args());
}

public function vrem($key, $element): \Relay\Cluster|false|int
{
return $this->initializeLazyObject()->vrem(...\func_get_args());
}

public function vsetattr($key, $element, $attributes): \Relay\Cluster|false|int
{
return $this->initializeLazyObject()->vsetattr(...\func_get_args());
}

public function vsim($key, $member, $options = null): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->vsim(...\func_get_args());
}

public function waitaof(array|string $key_or_address, int $numlocal, int $numremote, int $timeout): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->waitaof(...\func_get_args());
}

public function xackdel($key, $group, $ids, $mode = null): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->xackdel(...\func_get_args());
}

public function xdelex($key, $ids, $mode = null): \Relay\Cluster|array|false
{
return $this->initializeLazyObject()->xdelex(...\func_get_args());
}
}
} else {
/**
* @internal
*/
trait RelayCluster12Trait

Check failure on line 124 in src/Symfony/Component/Cache/Traits/Relay/RelayCluster12Trait.php

View workflow job for this annotation

GitHub Actions / Psalm

DuplicateClass

src/Symfony/Component/Cache/Traits/Relay/RelayCluster12Trait.php:124:11: DuplicateClass: Class Symfony\Component\Cache\Traits\Relay\RelayCluster12Trait has already been defined in /home/runner/work/symfony/symfony/src/Symfony/Component/Cache/Traits/Relay/RelayCluster12Trait.php (see https://psalm.dev/071)

Check failure on line 124 in src/Symfony/Component/Cache/Traits/Relay/RelayCluster12Trait.php

View workflow job for this annotation

GitHub Actions / Psalm

DuplicateClass

src/Symfony/Component/Cache/Traits/Relay/RelayCluster12Trait.php:124:11: DuplicateClass: Class Symfony\Component\Cache\Traits\Relay\RelayCluster12Trait has already been defined in /home/runner/work/symfony/symfony/src/Symfony/Component/Cache/Traits/Relay/RelayCluster12Trait.php (see https://psalm.dev/071)
{
public function waitaof(array|string $key_or_address, int $numlocal, int $numremote, int $timeout): \Relay\Relay|array|false
{
return $this->initializeLazyObject()->waitaof(...\func_get_args());
}
}
}
41 changes: 0 additions & 41 deletions src/Symfony/Component/Cache/Traits/Relay/WaitaofTrait.php

This file was deleted.

19 changes: 8 additions & 11 deletions src/Symfony/Component/Cache/Traits/RelayClusterProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

use Relay\Cluster;
use Relay\Relay;
use Symfony\Component\Cache\Traits\Relay\WaitaofTrait;
use Symfony\Component\Cache\Traits\Relay\RelayCluster11Trait;
use Symfony\Component\Cache\Traits\Relay\RelayCluster12Trait;
use Symfony\Component\VarExporter\LazyObjectInterface;
use Symfony\Contracts\Service\ResetInterface;

Expand All @@ -30,7 +31,8 @@ class RelayClusterProxy extends Cluster implements ResetInterface, LazyObjectInt
use RedisProxyTrait {
resetLazyObject as reset;
}
use WaitaofTrait;
use RelayCluster11Trait;
use RelayCluster12Trait;

public function __construct(
?string $name,
Expand Down Expand Up @@ -509,14 +511,14 @@ public function expiretime(mixed $key): Cluster|false|int
return $this->initializeLazyObject()->expiretime(...\func_get_args());
}

public function pexpireat(mixed $key, int $timestamp_ms): Cluster|bool
public function getWithMeta($key): Cluster|array|false
{
return $this->initializeLazyObject()->pexpireat(...\func_get_args());
return $this->initializeLazyObject()->getWithMeta(...\func_get_args());
}

public static function flushMemory(?string $endpointId = null, ?int $db = null): bool
public function pexpireat(mixed $key, int $timestamp_ms): Cluster|bool
{
return Cluster::flushMemory(...\func_get_args());
return $this->initializeLazyObject()->pexpireat(...\func_get_args());
}

public function pexpiretime(mixed $key): Cluster|false|int
Expand Down Expand Up @@ -659,11 +661,6 @@ public function ltrim(mixed $key, int $start, int $end): Cluster|bool
return $this->initializeLazyObject()->ltrim(...\func_get_args());
}

public static function maxMemory(): int
{
return Cluster::maxMemory();
}

public function hget(mixed $key, mixed $member): mixed
{
return $this->initializeLazyObject()->hget(...\func_get_args());
Expand Down
Loading