Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
19 | protected function validate($input): string |
||
20 | { |
||
21 | $settings = $this->getSettings(); |
||
22 | $min = $settings['min'] ?? self::MIN_LEN; |
||
23 | $max = $settings['max'] ?? self::MAX_LEN; |
||
24 | |||
25 | Assertion::string($input, 'Must be a string.'); |
||
26 | $password = trim($input); |
||
27 | Assertion::betweenLength($password, $min, $max, "Must be between $min and $max characters."); |
||
28 | |||
29 | return $password; |
||
30 | } |
||
32 |