GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

VerifiesPendingEmails   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 11
c 3
b 0
f 0
dl 0
loc 29
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A verify() 0 15 2
A authenticated() 0 3 1
1
<?php
2
3
namespace ProtoneMedia\LaravelVerifyNewEmail\Http;
4
5
use Illuminate\Support\Facades\Auth;
6
7
trait VerifiesPendingEmails
8
{
9
    /**
10
     * Mark the user's new email address as verified.
11
     *
12
     * @param  string $token
13
     *
14
     * @throws \ProtoneMedia\LaravelVerifyNewEmail\Http\InvalidVerificationLinkException
15
     */
16
    public function verify(string $token)
17
    {
18
        $user = app(config('verify-new-email.model'))->whereToken($token)->firstOr(['*'], function () {
0 ignored issues
show
Bug introduced by
The method whereToken() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

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

18
        $user = app(config('verify-new-email.model'))->/** @scrutinizer ignore-call */ whereToken($token)->firstOr(['*'], function () {

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
            throw new InvalidVerificationLinkException(
20
                __('The verification link is not valid anymore.')
0 ignored issues
show
Bug introduced by
It seems like __('The verification link is not valid anymore.') can also be of type array and array; however, parameter $message of ProtoneMedia\LaravelVeri...xception::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

20
                /** @scrutinizer ignore-type */ __('The verification link is not valid anymore.')
Loading history...
21
            );
22
        })->tap(function ($pendingUserEmail) {
23
            $pendingUserEmail->activate();
24
        })->user;
25
26
        if (config('verify-new-email.login_after_verification')) {
27
            Auth::guard()->login($user, config('verify-new-email.login_remember'));
28
        }
29
30
        return $this->authenticated();
31
    }
32
33
    protected function authenticated()
34
    {
35
        return redirect(config('verify-new-email.redirect_to'))->with('verified', true);
36
    }
37
}
38