PasswordType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 10
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A isValid() 0 3 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ecodev\Felix\Api\Scalar;
6
7
final class PasswordType extends AbstractStringBasedType
8
{
9
    public ?string $description = 'A password is a string of at least 12 characters';
10
11
    /**
12
     * Validate a password.
13
     */
14 14
    protected function isValid(?string $value): bool
15
    {
16 14
        return is_string($value) && mb_strlen($value) >= 12;
17
    }
18
}
19