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

public function delex($key, $options = null): \Relay\Relay|false|int
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->delex(...\func_get_args());
}

public function digest($key): \Relay\Relay|false|null|string
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->digest(...\func_get_args());
}

public function msetex($kvals, $ttl = null): \Relay\Relay|false|int
{
return ($this->lazyObjectState->realInstance ??= ($this->lazyObjectState->initializer)())->msetx(...\func_get_args());
}
}
} else {
/**
* @internal
*/
trait Relay20Trait

Check failure on line 44 in src/Symfony/Component/Cache/Traits/Relay/Relay20Trait.php

View workflow job for this annotation

GitHub Actions / Psalm

DuplicateClass

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

Check failure on line 44 in src/Symfony/Component/Cache/Traits/Relay/Relay20Trait.php

View workflow job for this annotation

GitHub Actions / Psalm

DuplicateClass

src/Symfony/Component/Cache/Traits/Relay/Relay20Trait.php:44:11: DuplicateClass: Class Symfony\Component\Cache\Traits\Relay\Relay20Trait has already been defined in /home/runner/work/symfony/symfony/src/Symfony/Component/Cache/Traits/Relay/Relay20Trait.php (see https://psalm.dev/071)
{
}
}
2 changes: 2 additions & 0 deletions src/Symfony/Component/Cache/Traits/RelayProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
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\Relay20Trait;
use Symfony\Component\Cache\Traits\Relay\SwapdbTrait;
use Symfony\Component\VarExporter\LazyObjectInterface;
use Symfony\Component\VarExporter\LazyProxyTrait;
Expand Down Expand Up @@ -58,6 +59,7 @@ class RelayProxy extends \Relay\Relay implements ResetInterface, LazyObjectInter
use Relay11Trait;
use Relay12Trait;
use Relay121Trait;
use Relay20Trait;
use SwapdbTrait;

private const LAZY_OBJECT_PROPERTY_SCOPES = [];
Expand Down
Loading