for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace WITR\Services;
use Closure;
use Illuminate\Contracts\Auth\Guard;
class Whitelist {
protected $fromIp;
protected $toIp;
/**
* Create a new filter instance.
*
* @param Guard $auth
$auth
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @return void
@return
Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.
Please refer to the PHP core documentation on constructors.
*/
public function __construct($fromIp, $toIp)
{
$this->fromIp = $fromIp;
$this->toIp = $toIp;
}
* Handle an incoming request.
* @param \Illuminate\Http\Request $request
* @param \Closure $next
$next
* @return mixed
public function inRange($request)
$ip = $request->getClientIp();
if( (ip2long($this->fromIp) <= ip2long($ip)) && (ip2long($ip) <= ip2long($this->toIp))) {
return true;
} else {
return false;
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.