| Total Complexity | 5 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | final class Length implements Rule |
||
| 12 | { |
||
| 13 | /** @var int */ |
||
| 14 | private $min; |
||
| 15 | |||
| 16 | /** @var int|null */ |
||
| 17 | private $max; |
||
| 18 | |||
| 19 | /** @var string */ |
||
| 20 | private $encoding; |
||
| 21 | |||
| 22 | 2 | public function __construct(int $min, ?int $max = null, string $encoding = 'utf8') |
|
| 27 | 2 | } |
|
| 28 | |||
| 29 | 2 | public function __invoke(string $password) : void |
|
| 42 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
integervalues, zero is a special case, in particular the following results might be unexpected: