Completed
Pull Request — master (#17)
by Fèvre
04:45 queued 02:31
created

ForgotPasswordController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 4
dl 0
loc 48
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A showLinkRequestForm() 0 4 1
A sendResetLinkResponse() 0 6 1
1
<?php
2
namespace Xetaravel\Http\Controllers\Auth;
3
4
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
5
use Xetaravel\Http\Controllers\Controller;
6
7
class ForgotPasswordController extends Controller
8
{
9
    /*
10
    |--------------------------------------------------------------------------
11
    | Password Reset Controller
12
    |--------------------------------------------------------------------------
13
    |
14
    | This controller is responsible for handling password reset emails and
15
    | includes a trait which assists in sending these notifications from
16
    | your application to your users. Feel free to explore this trait.
17
    |
18
    */
19
    use SendsPasswordResetEmails;
20
21
    /**
22
     * Create a new controller instance.
23
     *
24
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
25
     */
26
    public function __construct()
27
    {
28
        $this->middleware('guest');
29
    }
30
31
    /**
32
     * Display the form to request a password reset link.
33
     *
34
     * @return \Illuminate\Http\Response
0 ignored issues
show
Documentation introduced by
Should the return type not be \Illuminate\View\View|\I...\Contracts\View\Factory?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
35
     */
36
    public function showLinkRequestForm()
37
    {
38
        return view('Auth.passwords.email');
39
    }
40
41
    /**
42
     * Get the response for a successful password reset link.
43
     *
44
     * @param string $response
45
     *
46
     * @return \Illuminate\Http\RedirectResponse
47
     */
48
    protected function sendResetLinkResponse($response)
49
    {
50
        return redirect()
51
            ->route('page.index')
52
            ->with('success', $response);
53
    }
54
}
55