for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Modules\Sellers\Http\Middleware;
use Closure;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Redirect;
use Symfony\Component\HttpFoundation\Response;
/**
* @see \Illuminate\Auth\Middleware\EnsureEmailIsVerified
*/
class EnsureSellerEmailIsVerified
{
* Handle an incoming request.
public function handle(Request $request, Closure $next, ?string $redirectToRoute = null): Response
if (! $request->user('seller')
|| ($request->user('seller') instanceof MustVerifyEmail
&& ! $request->user('seller')->hasVerifiedEmail())) {
return $request->expectsJson()
? abort(403, 'Your email address is not verified.')
abort(403, 'Your email address is not verified.')
null
This check looks for function or method calls that always return null and whose return value is used.
class A { function getObject() { return null; } } $a = new A(); if ($a->getObject()) {
The method getObject() can return nothing but null, so it makes no sense to use the return value.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
: Redirect::route($redirectToRoute ?: 'seller.verification.notice');
}
return $next($request);
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.