Passed
Push — feature/delete_items ( abdbb3...c1e89b )
by Tristan
09:18
created

PasswordCorrectRule::passes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 2
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace App\Services\Validation\Rules;
4
5
use Illuminate\Contracts\Validation\Rule;
6
use Illuminate\Support\Facades\Hash;
7
use Illuminate\Support\Facades\Auth;
8
use Illuminate\Support\Facades\Lang;
9
10
class PasswordCorrectRule implements Rule
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class PasswordCorrectRule
Loading history...
11
{
12
    public function passes($attribute, $value)
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function passes()
Loading history...
13
    {
14
        return Hash::check($value, Auth::user()->getAuthPassword());
15
    }
16
17
    public function message()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function message()
Loading history...
18
    {
19
        return Lang::get('validation.custom.password_correct');
20
    }
21
}
22