src/Validator/Specific/Password.php
private function validateSpecialCharacter(): bool
    {
        if ($this->options['require-special-character'] === true) {
            if (!\preg_match('/'.$this->options['special-character-pattern'].'/', (string)$this->value)) {
                $this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_CONTAIN_SPECIAL_CHARACTER);
                return false;
            }
        }
        return true;
    }
private function validateSpecialCharacter(): bool
    {
        if ($this->options['require-special-character'] === true) {
            if (!\preg_match('/'.$this->options['special-character-pattern'].'/', (string)$this->value)) {
                $this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_CONTAIN_SPECIAL_CHARACTER);
                return false;
            }
        }
        return true;
    }
private function validateSpecialCharacter ( ) : bool { if ( $ this -> options [ 'require-special-character' ] === true ) { if ( ! \ preg_match ( '/' . $ this -> options [ 'special-character-pattern' ] . '/' , ( string ) $ this -> value ) ) { $ this -> setError ( self :: VALIDATOR_ERROR_PASSWORD_MUST_CONTAIN_SPECIAL_CHARACTER ) ; return false ; } } return true ; }
Validates that password contains a special character

@return bool
Validates that password contains a special character