Md5   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 24
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A hash() 0 4 1
A unHash() 0 4 1
1
<?php
2
namespace FMUP\Crypt\Driver;
3
4
use FMUP\Crypt\CryptInterface;
5
use FMUP\Crypt\Exception;
6
7
class Md5 implements CryptInterface
8
{
9
10
    /**
11
     * Hash the given password
12
     * @param string $password
13
     * @return string
14
     */
15 3
    public function hash($password)
16
    {
17 3
        return md5($password);
18
    }
19
20
    /**
21
     *
22
     * @param string $password
23
     * @throws Exception
24
     * @return string
25
     */
26 1
    public function unHash($password)
27
    {
28 1
        throw new Exception('Invalid method for this driver');
29
    }
30
}
31