Skip to content

Commit 92c0d18

Browse files
committed
ensure compatibility with RelayCluster 0.20.0
1 parent 8733b96 commit 92c0d18

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Cache\Traits\Relay;
13+
14+
if (version_compare(phpversion('relay'), '0.20.0', '>=')) {
15+
/**
16+
* @internal
17+
*/
18+
trait RelayCluster20Trait
19+
{
20+
public function _digest($value): string
21+
{
22+
return $this->initializeLazyObject()->_digest(...\func_get_args());
23+
}
24+
25+
public function delex($key, $options = null): \Relay\Cluster|false|int
26+
{
27+
return $this->initializeLazyObject()->delex(...\func_get_args());
28+
}
29+
30+
public function digest($key): \Relay\Cluster|false|null|string
31+
{
32+
return $this->initializeLazyObject()->digest(...\func_get_args());
33+
}
34+
35+
public function wait($key_or_address, $replicas, $timeout): \Relay\Cluster|false|int
36+
{
37+
return $this->initializeLazyObject()->digest(...\func_get_args());
38+
}
39+
}
40+
} else {
41+
/**
42+
* @internal
43+
*/
44+
trait RelayCluster20Trait
45+
{
46+
}
47+
}

src/Symfony/Component/Cache/Traits/RelayClusterProxy.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\Cache\Traits\Relay\RelayCluster11Trait;
1717
use Symfony\Component\Cache\Traits\Relay\RelayCluster121Trait;
1818
use Symfony\Component\Cache\Traits\Relay\RelayCluster12Trait;
19+
use Symfony\Component\Cache\Traits\Relay\RelayCluster20Trait;
1920
use Symfony\Component\VarExporter\LazyObjectInterface;
2021
use Symfony\Contracts\Service\ResetInterface;
2122

@@ -35,6 +36,7 @@ class RelayClusterProxy extends Cluster implements ResetInterface, LazyObjectInt
3536
use RelayCluster11Trait;
3637
use RelayCluster121Trait;
3738
use RelayCluster12Trait;
39+
use RelayCluster20Trait;
3840

3941
public function __construct(
4042
?string $name,

0 commit comments

Comments
 (0)