CheckPasswordLengthTrait::isPasswordTooLong()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of web-stack
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace Slick\WebStack\Domain\Security\PasswordHasher\Hasher;
13
14
use Slick\WebStack\Domain\Security\PasswordHasher\PasswordHasherInterface;
15
use SensitiveParameter;
0 ignored issues
show
Bug introduced by
The type SensitiveParameter was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
16
17
/**
18
 * CheckPasswordLengthTrait
19
 *
20
 * @package Slick\WebStack\Domain\Security\PasswordHasher\Hasher
21
 */
22
trait CheckPasswordLengthTrait
23
{
24
25
    /**
26
     * Checks if the provided password is too long.
27
     *
28
     * @param string $password The password to be checked.
29
     * @return bool Returns true if the password is too long, false otherwise.
30
     */
31
    private function isPasswordTooLong(#[SensitiveParameter] string $password): bool
32
    {
33
        return PasswordHasherInterface::MAX_PASSWORD_LENGTH < strlen($password);
34
    }
35
}
36