1 | <?php |
||
9 | class PasswordSpecialCharacterValidator implements Validator |
||
10 | { |
||
11 | /** @var string[] $whitelist */ |
||
12 | private $whitelist; |
||
13 | /** @var int $minimum */ |
||
14 | private $minimum; |
||
15 | |||
16 | /** |
||
17 | * PasswordSpecialCharacterValidator constructor. |
||
18 | * @param int $minimum The minimum number of special characters to require. |
||
19 | * @param string[] $whitelist The whitelist of special characters to consider valid |
||
20 | * @see https://www.owasp.org/index.php/Password_special_characters This is the default special character whitelist |
||
21 | */ |
||
22 | public function __construct(int $minimum = 1, array $whitelist = []) |
||
66 | |||
67 | /** {@inheritdoc} */ |
||
68 | public function validate(string $password): bool |
||
79 | } |
||
80 |