Passed
Push — task/laravel-breadcrumbs ( 3beccb...a96280 )
by Yonathan
10:46 queued 10s
created

TwoFactorRequiredException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 8
c 0
b 0
f 0
dl 0
loc 30
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 11 1
A getStatusCode() 0 3 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