protonemedia /
laravel-verify-new-email
| 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
|
|||||
| 19 | throw new InvalidVerificationLinkException( |
||||
| 20 | __('The verification link is not valid anymore.') |
||||
|
0 ignored issues
–
show
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
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 |
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.