Passed
Pull Request — 1.2 (#405)
by
unknown
08:49
created

OauthRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 33
ccs 0
cts 7
cp 0
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A all() 0 7 1
A rules() 0 7 1
1
<?php
2
3
namespace A17\Twill\Http\Requests\Admin;
4
5
use Illuminate\Validation\Rule;
6
7
class OauthRequest extends Request
8
{
9
10
    protected $redirectRoute = 'admin.login.form';
11
12
13
    /**
14
     * Include route parameters for validation
15
     *
16
     * @return array
17
     */
18
    public function all($keys = null)
0 ignored issues
show
Unused Code introduced by
The parameter $keys 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

18
    public function all(/** @scrutinizer ignore-unused */ $keys = null)

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...
19
    {
20
21
        $data = parent::all();
22
        $data['provider'] = $this->input('provider', $this->route('provider'));
23
24
        return $data;
25
26
    }
27
28
    /**
29
     * Gets the validation rules that apply to the request.
30
     *
31
     * @return array
32
     */
33
    public function rules()
34
    {
35
36
        return [
37
            'provider' => [
38
                'required',
39
                Rule::in(config('twill.oauth.providers', []))
40
            ],
41
        ];
42
43
    }
44
45
}
46