public function verifyPassword(User $user, string $password): bool
    {
        $this->enforcePasswordStrength($password);

        $auth = $this->authenticationProvider->findByUserId($user->getId());
        if (!$auth) {
            throw new NoSuchUserException();
        }

        return password_verify($password, $auth->getHash());
    }
public function verifyPassword(User $user, string $password): bool
    {
        $this->enforcePasswordStrength($password);

        $auth = $this->authenticationProvider->findByUserId($user->getId());
        if (!$auth) {
            throw new NoSuchUserException();
        }

        return password_verify($password, $auth->getHash());
    }
public function verifyPassword ( User $ user , string $ password ) : bool { $ this -> enforcePasswordStrength ( $ password ) ; $ auth = $ this -> authenticationProvider -> findByUserId ( $ user -> getId ( ) ) ; if ( ! $ auth ) { throw new NoSuchUserException ( ) ; } return password_verify ( $ password , $ auth -> getHash ( ) ) ; }
Validate user password

@param User   $user     The user to validate password for
@param string $password Cleartext password that'w will be verified

@return bool

@throws NoSuchUserException
@throws WeakPasswordException
Validate user password