RedisCluster61ProxyTrait.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Cache\Traits;
  11. if (version_compare(phpversion('redis'), '6.1.0-dev', '>')) {
  12. /**
  13. * @internal
  14. */
  15. trait RedisCluster61ProxyTrait
  16. {
  17. public function getex($key, $options = []): \RedisCluster|string|false
  18. {
  19. return $this->initializeLazyObject()->getex(...\func_get_args());
  20. }
  21. public function publish($channel, $message): \RedisCluster|bool|int
  22. {
  23. return $this->initializeLazyObject()->publish(...\func_get_args());
  24. }
  25. public function waitaof($key_or_address, $numlocal, $numreplicas, $timeout): \RedisCluster|array|false
  26. {
  27. return $this->initializeLazyObject()->waitaof(...\func_get_args());
  28. }
  29. }
  30. } else {
  31. /**
  32. * @internal
  33. */
  34. trait RedisCluster61ProxyTrait
  35. {
  36. public function publish($channel, $message): \RedisCluster|bool
  37. {
  38. return $this->initializeLazyObject()->publish(...\func_get_args());
  39. }
  40. }
  41. }