for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Hideyo\Ecommerce\Framework\Middleware;
use Closure;
use Hideyo\Ecommerce\Framework\Services\Shop\ShopFacade as ShopService;
class AuthenticateAdmin
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
$guard
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function handle($request, Closure $next, /** @scrutinizer ignore-unused */ $guard = null)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
if (auth()->guard('hideyobackend')->guest()) {
if ($request->ajax()) {
return response('Unauthorized.', 401);
}
return redirect()->guest('/admin/security/login');
if (auth()->guard('hideyobackend')->check()) {
view()->share('this_user', auth()->guard('hideyobackend')->user());
view()->share('available_shops', ShopService::selectAll());
return $next($request);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.