Completed
Branch feature/Authentication4 (554da3)
by Schlaefer
03:43
created

LegacyPasswordHasherSaltless::hash()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * Saito - The Threaded Web Forum
7
 *
8
 * @copyright Copyright (c) the Saito Project Developers
9
 * @link https://github.com/Schlaefer/Saito
10
 * @license http://opensource.org/licenses/MIT
11
 */
12
13
namespace App\Auth;
14
15
use Authentication\PasswordHasher\LegacyPasswordHasher;
16
use Cake\Utility\Security;
17
18
/**
19
 * Check legacy passwords but without using Cake's salt
20
 */
21
class LegacyPasswordHasherSaltless extends LegacyPasswordHasher
22
{
23
    /**
24
     * {@inheritDoc}
25
     */
26
    public function hash($password)
27
    {
28
        return Security::hash($password, $this->_config['hashType'], false);
0 ignored issues
show
Bug introduced by
It seems like $password defined by parameter $password on line 26 can also be of type array; however, Cake\Utility\Security::hash() does only seem to accept string, maybe add an additional type check?

This check looks at variables that have been passed in as parameters and are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
29
    }
30
}
31