Passed
Pull Request — master (#83)
by Ron
25:57
created

UserChangePasswordRequest   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;
4
5
use App\Rules\ValidatePassword;
6
7
use Illuminate\Foundation\Http\FormRequest;
8
9
class UserChangePasswordRequest extends FormRequest
10
{
11
    /**
12
     * Determine if the user is authorized to make this request.
13
     *
14
     * @return bool
15
     */
16 8
    public function authorize()
17
    {
18 8
        return true;
19
    }
20
21
    /**
22
     * Get the validation rules that apply to the request.
23
     *
24
     * @return array
25
     */
26 8
    public function rules()
27
    {
28
        return [
29 8
            'oldPass' => ['required', new ValidatePassword],
30 8
            'newPass' => 'required|string|min:6|confirmed|different:oldPass'
31
        ];
32
    }
33
}
34