Passed
Push — release/1.0.17 ( f9f3c1...f9f3c1 )
by Grant
10:46 queued 13s
created

TwoFactorRequiredException::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
c 0
b 0
f 0
dl 0
loc 11
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Exceptions;
4
5
use Exception;
6
use Illuminate\Support\Facades\Lang;
7
8
class TwoFactorRequiredException extends Exception
9
{
10
    /**
11
     * Render the exception into an HTTP response.
12
     *
13
     * @param  \Illuminate\Http\Request $request Incoming request object.
14
     * @return \Illuminate\Http\Response|\Illuminate\Contracts\Routing\ResponseFactory
15
     */
16
    public function render(\Illuminate\Http\Request $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

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

16
    public function render(/** @scrutinizer ignore-unused */ \Illuminate\Http\Request $request)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
17
    {
18
        return response()->view(
19
            'errors/two_factor_required',
20
            [
21
                'exception' => $this,
22
                'error' => [
23
                    'title' => Lang::get('errors.title'),
24
                ],
25
            ],
26
            $this->getStatusCode()
27
        );
28
    }
29
30
    /**
31
     * Override, custom exception doesn't return a status code.
32
     *
33
     * @return mixed
34
     */
35
    public function getStatusCode()
36
    {
37
        return 403;
38
    }
39
}
40