SendsPasswordResetEmails::sendResetLinkEmail()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 7
rs 10
1
<?php
2
3
namespace Slides\Connector\Auth\Concerns;
4
5
use Illuminate\Http\Request;
6
use Slides\Connector\Auth\Facades\AuthService;
7
use Illuminate\Foundation\Auth\SendsPasswordResetEmails as BaseSendsPasswordResetEmails;
8
9
/**
10
 * Trait SendsPasswordResetEmails
11
 *
12
 * @package Slides\Connector\Auth\Concerns
13
 */
14
trait SendsPasswordResetEmails
15
{
16
    use BaseSendsPasswordResetEmails;
17
18
    /**
19
     * Send a reset link to the given user.
20
     *
21
     * @param \Illuminate\Http\Request $request
22
     *
23
     * @return \Illuminate\Http\RedirectResponse
24
     */
25
    public function sendResetLinkEmail(Request $request)
26
    {
27
        $this->validateEmail($request);
28
29
        return AuthService::forgot($request->input('email'))
0 ignored issues
show
Bug introduced by
The method forgot() does not exist on Slides\Connector\Auth\Facades\AuthService. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

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

29
        return AuthService::/** @scrutinizer ignore-call */ forgot($request->input('email'))
Loading history...
30
            ? back()->with('status', 'We have e-mailed your password reset link!')
31
            : back()->withErrors(['email' => 'We can\'t find a user with that e-mail address.']);
32
    }
33
}