public function changePassword($username, $password)
    {
        $user = $this->findUserByUsernameOrThrowException($username);
        $user->setPlainPassword($password);
        $this->userManager->updateUser($user);

        $event = new UserEvent($user, $this->getRequest());
        $this->dispatcher->dispatch(Events::USER_PASSWORD_CHANGED, $event);
    }
public function changePassword($username, $password)
    {
        $user = $this->findUserByUsernameOrThrowException($username);
        $user->setPlainPassword($password);
        $this->userManager->updateUser($user);

        $event = new UserEvent($user, $this->getRequest());
        $this->dispatcher->dispatch(Events::USER_PASSWORD_CHANGED, $event);
    }
public function changePassword ( $ username , $ password ) { $ user = $ this -> findUserByUsernameOrThrowException ( $ username ) ; $ user -> setPlainPassword ( $ password ) ; $ this -> userManager -> updateUser ( $ user ) ; $ event = new UserEvent ( $ user , $ this -> getRequest ( ) ) ; $ this -> dispatcher -> dispatch ( Events :: USER_PASSWORD_CHANGED , $ event ) ; }
Changes the password for the given user.

@param string $username
@param string $password
Changes the password for the given user .