MD5Hasher   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 14
ccs 3
cts 6
cp 0.5
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A make() 0 5 2
A check() 0 5 2
1
<?php
2
namespace FirstShuai\Hasher;
3
/**
4
 * Created by PhpStorm.
5
 * User: FirstShuai
6
 * Date: 2016/10/28
7
 * Time: 下午3:09
8
 */
9
class MD5Hasher
10
{
11 1
    public function make($value, array $options = [])
12
    {
13 1
        $salt = isset($options['salt']) ? $options['salt'] : '';
14 1
        return md5($value . $salt);
15
    }
16
17
    public function check($value, $hasherValer, array $options = [])
18
    {
19
        $salt = isset($options['salt']) ? $options['salt'] : '';
20
        return $hasherValer === md5($value . $salt);
21
    }
22
}