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
51 changes: 51 additions & 0 deletions src/Symfony/Component/Cache/Traits/Relay/Relay121Trait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?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.1', '>=')) {
/**
* @internal
*/
trait Relay121Trait
{
public function hgetWithMeta($hash, $member): \Relay\Relay|array|false
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->hgetWithMeta(...\func_get_args());
}

public function select($db): \Relay\Relay|bool|string
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->select(...\func_get_args());
}

public function watch($key, ...$other_keys): \Relay\Relay|bool|string
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->watch(...\func_get_args());
}
}
} else {
/**
* @internal
*/
trait Relay121Trait

Check failure on line 39 in src/Symfony/Component/Cache/Traits/Relay/Relay121Trait.php

View workflow job for this annotation

GitHub Actions / Psalm

DuplicateClass

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

Check failure on line 39 in src/Symfony/Component/Cache/Traits/Relay/Relay121Trait.php

View workflow job for this annotation

GitHub Actions / Psalm

DuplicateClass

src/Symfony/Component/Cache/Traits/Relay/Relay121Trait.php:39:11: DuplicateClass: Class Symfony\Component\Cache\Traits\Relay\Relay121Trait has already been defined in /home/runner/work/symfony/symfony/src/Symfony/Component/Cache/Traits/Relay/Relay121Trait.php (see https://psalm.dev/071)
{
public function select($db): \Relay\Relay|bool
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->select(...\func_get_args());
}

public function watch($key, ...$other_keys): \Relay\Relay|bool
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->watch(...\func_get_args());
}
}
}
12 changes: 2 additions & 10 deletions src/Symfony/Component/Cache/Traits/RelayProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Symfony\Component\Cache\Traits\Relay\NullableReturnTrait;
use Symfony\Component\Cache\Traits\Relay\PfcountTrait;
use Symfony\Component\Cache\Traits\Relay\Relay11Trait;
use Symfony\Component\Cache\Traits\Relay\Relay121Trait;
use Symfony\Component\Cache\Traits\Relay\Relay12Trait;
use Symfony\Component\Cache\Traits\Relay\SwapdbTrait;
use Symfony\Component\VarExporter\LazyObjectInterface;
Expand Down Expand Up @@ -56,6 +57,7 @@ class RelayProxy extends \Relay\Relay implements ResetInterface, LazyObjectInter
use RelayProxyTrait;
use Relay11Trait;
use Relay12Trait;
use Relay121Trait;
use SwapdbTrait;

private const LAZY_OBJECT_PROPERTY_SCOPES = [];
Expand Down Expand Up @@ -250,11 +252,6 @@ public function rawCommand($cmd, ...$args): mixed
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->rawCommand(...\func_get_args());
}

public function select($db): \Relay\Relay|bool
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->select(...\func_get_args());
}

public function auth(#[\SensitiveParameter] $auth): bool
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->auth(...\func_get_args());
Expand Down Expand Up @@ -940,11 +937,6 @@ public function wait($replicas, $timeout): \Relay\Relay|false|int
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->wait(...\func_get_args());
}

public function watch($key, ...$other_keys): \Relay\Relay|bool
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->watch(...\func_get_args());
}

public function unwatch(): \Relay\Relay|bool
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->unwatch(...\func_get_args());
Expand Down
Loading