GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Branch develop (0737e3)
by Maximilian
11:49
created

CryptPasswordHasher::compareWith()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace Ma27\ApiKeyAuthenticationBundle\Service\Password;
4
5
/**
6
 * Hasher which uses the crypt algorithm.
7
 */
8
class CryptPasswordHasher implements PasswordHasherInterface
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function generateHash($password)
14
    {
15
        return crypt($password, sprintf('$6$rounds=3000$%s$', $this->generateSalt()));
16
    }
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function compareWith($password, $raw)
22
    {
23
        return crypt($raw, $password) === $password;
24
    }
25
26
    /**
27
     * Generates a salt using the openssl API.
28
     *
29
     * @return string
30
     */
31
    protected function generateSalt()
32
    {
33
        return bin2hex(openssl_random_pseudo_bytes(10));
34
    }
35
}
36