Passed
Branch dev5a (b4693d)
by Ron
27:36
created

UserPasswordRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A rules() 0 5 1
A authorize() 0 3 1
1
<?php
2
3
namespace App\Http\Requests\User;
4
5
use Illuminate\Support\Facades\Auth;
6
use Illuminate\Foundation\Http\FormRequest;
7
8
use App\Rules\ValidatePassword;
9
10
class UserPasswordRequest extends FormRequest
11
{
12
    /**
13
     * Determine if the user is authorized to make this request.
14
     *
15
     * @return bool
16
     */
17 4
    public function authorize()
18
    {
19 4
        return Auth::check();
20
    }
21
22
    /**
23
     * Get the validation rules that apply to the request.
24
     *
25
     * @return array
26
     */
27 4
    public function rules()
28
    {
29
        return [
30 4
            'current'  => ['required', new ValidatePassword],
31 4
            'password' => 'required|string|min:6|confirmed|different:current'
32
        ];
33
    }
34
}
35