PrefixHelpers.php 512 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace Predis\Commands;
  3. class PrefixHelpers
  4. {
  5. public static function multipleKeys(Array $arguments, $prefix)
  6. {
  7. foreach ($arguments as &$key) {
  8. $key = "$prefix$key";
  9. }
  10. return $arguments;
  11. }
  12. public static function skipLastArgument(Array $arguments, $prefix)
  13. {
  14. $length = count($arguments);
  15. for ($i = 0; $i < $length - 1; $i++) {
  16. $arguments[$i] = "$prefix{$arguments[$i]}";
  17. }
  18. return $arguments;
  19. }
  20. }