Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use func_get_args() instead of [$key, $count]
  • Loading branch information
zingimmick authored Feb 1, 2021
commit d0a97359e23d734f443fe5ddeeb273aa69c3f53f
10 changes: 3 additions & 7 deletions src/Illuminate/Redis/Connections/PhpRedisConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,14 +195,10 @@ public function brpop(...$arguments)
* @param int|null $count
* @return mixed|false
*/
public function spop($key, $count = null)
public function spop($key, $count = 1)
{
$parameters = [$key];
if ($count !== null) {
$parameters[] = $count;
}

return $this->command('sPop', $parameters);
// use func_get_args() instead of [$key, $count] to fix the return type when called without the count argument.
return $this->command('spop', func_get_args());
}

/**
Expand Down