for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Equip\Queue\Driver;
use Redis;
class RedisDriver implements DriverInterface
{
/**
* @var Redis
*/
private $redis;
* @param Redis $redis
public function __construct(Redis $redis)
$this->redis = $redis;
}
* @inheritdoc
public function push($queue, $message)
return (bool) $this->redis->rPush($queue, $message);
public function pop($queue)
list($_, $message) = $this->redis->blPop([$queue], 5) ?: null;
$_
list($first,,$third)
This checks looks for assignemnts to variables using the list(...) function, where not all assigned variables are subsequently used.
list(...)
Consider the following code example.
<?php function returnThreeValues() { return array('a', 'b', 'c'); } list($a, $b, $c) = returnThreeValues(); print $a . " - " . $c;
Only the variables $a and $c are used. There was no need to assign $b.
$a
$c
$b
Instead, the list call could have been.
list($a,, $c) = returnThreeValues();
return $message;
This checks looks for assignemnts to variables using the
list(...)
function, where not all assigned variables are subsequently used.Consider the following code example.
Only the variables
$a
and$c
are used. There was no need to assign$b
.Instead, the list call could have been.