ScanCaller.php 885 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. namespace Hyperf\Redis\Traits;
  12. trait ScanCaller
  13. {
  14. public function scan(&$cursor, ...$arguments)
  15. {
  16. return $this->__call('scan', array_merge([&$cursor], $arguments));
  17. }
  18. public function hScan($key, &$cursor, ...$arguments)
  19. {
  20. return $this->__call('hScan', array_merge([$key, &$cursor], $arguments));
  21. }
  22. public function zScan($key, &$cursor, ...$arguments)
  23. {
  24. return $this->__call('zScan', array_merge([$key, &$cursor], $arguments));
  25. }
  26. public function sScan($key, &$cursor, ...$arguments)
  27. {
  28. return $this->__call('sScan', array_merge([$key, &$cursor], $arguments));
  29. }
  30. }