SHAHasher::check()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace App\Libraries\ShaHash;
5
6
7
use Illuminate\Contracts\Hashing\Hasher as HasherContract;
8
use Illuminate\Hashing\HashManager;
9
10
class SHAHasher  extends HashManager implements HasherContract
11
{
12
13
14
    public function check($value, $hashedValue, array $options = [])
15
    {
16
        return password_verify ($value , $hashedValue);
17
    }
18
19
20
    public function make($value, array $options = [])
21
    {
22
        return password_hash($value,PASSWORD_DEFAULT,$options);
23
    }
24
25
26
27
28
    public function needsRehash($hashedValue, array $options = [])
29
    {
30
        return password_needs_rehash($hashedValue,$options);
0 ignored issues
show
Bug introduced by
$options of type array is incompatible with the type integer|null|string expected by parameter $algo of password_needs_rehash(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

30
        return password_needs_rehash($hashedValue,/** @scrutinizer ignore-type */ $options);
Loading history...
31
    }
32
33
34
    public function info($hashedValue)
35
    {
36
        // TODO: Implement info() method.
37
        return $hashedValue;
38
    }
39
40
}
41