EmailVerificationPromptController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 10
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 5 2
1
<?php
2
3
namespace App\Http\Controllers\Auth;
4
5
use App\Http\Controllers\Controller;
6
use Illuminate\Http\RedirectResponse;
7
use Illuminate\Http\Request;
8
use Inertia\Inertia;
9
use Inertia\Response;
10
11
class EmailVerificationPromptController extends Controller
12
{
13
    /**
14
     * Display the email verification prompt.
15
     */
16
    public function __invoke(Request $request): RedirectResponse|Response
17
    {
18
        return $request->user()->hasVerifiedEmail()
0 ignored issues
show
Bug introduced by
The method user() does not exist on Illuminate\Http\Request. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        return $request->/** @scrutinizer ignore-call */ user()->hasVerifiedEmail()

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
19
                    ? redirect()->intended(route('dashboard', absolute: false))
20
                    : Inertia::render('Auth/VerifyEmail', ['status' => session('status')]);
21
    }
22
}
23