MoveTrait.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\Relay;
  11. if (version_compare(phpversion('relay'), '0.9.0', '>=')) {
  12. /**
  13. * @internal
  14. */
  15. trait MoveTrait
  16. {
  17. public function blmove($srckey, $dstkey, $srcpos, $dstpos, $timeout): mixed
  18. {
  19. return $this->initializeLazyObject()->blmove(...\func_get_args());
  20. }
  21. public function lmove($srckey, $dstkey, $srcpos, $dstpos): mixed
  22. {
  23. return $this->initializeLazyObject()->lmove(...\func_get_args());
  24. }
  25. }
  26. } else {
  27. /**
  28. * @internal
  29. */
  30. trait MoveTrait
  31. {
  32. public function blmove($srckey, $dstkey, $srcpos, $dstpos, $timeout): \Relay\Relay|false|string|null
  33. {
  34. return $this->initializeLazyObject()->blmove(...\func_get_args());
  35. }
  36. public function lmove($srckey, $dstkey, $srcpos, $dstpos): \Relay\Relay|false|string|null
  37. {
  38. return $this->initializeLazyObject()->lmove(...\func_get_args());
  39. }
  40. }
  41. }