src/Validator/Specific/Password.php
private function validateDifferentPreviousOne(): bool
    {
        if ($this->options['require-different-than-previous-one'] === true) {
            if (isset($this->options['stored-passwords'][0])) {
                $passwordHash = (string)$this->value;
                if (PasswordEnctyption::compare($passwordHash, $this->options['stored-passwords'][0])) {
                    $this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_BE_DIFFERENT_THAN_PREVIOUS_ONE);
                    return false;
                }
            }
        }
        return true;
    }
private function validateDifferentPreviousOne(): bool
    {
        if ($this->options['require-different-than-previous-one'] === true) {
            if (isset($this->options['stored-passwords'][0])) {
                $passwordHash = (string)$this->value;
                if (PasswordEnctyption::compare($passwordHash, $this->options['stored-passwords'][0])) {
                    $this->setError(self::VALIDATOR_ERROR_PASSWORD_MUST_BE_DIFFERENT_THAN_PREVIOUS_ONE);
                    return false;
                }
            }
        }
        return true;
    }
private function validateDifferentPreviousOne ( ) : bool { if ( $ this -> options [ 'require-different-than-previous-one' ] === true ) { if ( isset ( $ this -> options [ 'stored-passwords' ] [ 0 ] ) ) { $ passwordHash = ( string ) $ this -> value ; if ( PasswordEnctyption :: compare ( $ passwordHash , $ this -> options [ 'stored-passwords' ] [ 0 ] ) ) { $ this -> setError ( self :: VALIDATOR_ERROR_PASSWORD_MUST_BE_DIFFERENT_THAN_PREVIOUS_ONE ) ; return false ; } } } return true ; }
Validates that password is different than previous one

@return bool
Validates that password is different than previous one