DefaultPasswordHashService   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A hash() 0 4 1
A verify() 0 4 1
1
<?php
2
3
namespace OpenTribes\Core\Silex\Service;
4
5
6
use OpenTribes\Core\Service\PasswordHashService;
7
8
class DefaultPasswordHashService implements PasswordHashService
9
{
10
    /**
11
     * @param $rawPassword
12
     * @return string
13
     */
14 2
    public function hash($rawPassword)
15
    {
16 2
       return password_hash($rawPassword,PASSWORD_DEFAULT);
17
    }
18
19
    /**
20
     * @param $hash
21
     * @param $rawPassword
22
     * @return bool
23
     */
24 1
    public function verify($rawPassword, $hash)
25
    {
26 1
        return password_verify($rawPassword,$hash);
27
    }
28
29
}