src/Administration.php
public function changePasswordForUserByUsername($username, $newPassword) {
		$userData = $this->getUserDataByUsername(
			\trim($username),
			[ 'id' ]
		);

		$this->changePasswordForUserById(
			(int) $userData['id'],
			$newPassword
		);
	}
public function changePasswordForUserByUsername($username, $newPassword) {
		$userData = $this->getUserDataByUsername(
			\trim($username),
			[ 'id' ]
		);

		$this->changePasswordForUserById(
			(int) $userData['id'],
			$newPassword
		);
	}
public function changePasswordForUserByUsername ( $ username , $ newPassword ) { $ userData = $ this -> getUserDataByUsername ( \ trim ( $ username ) , [ 'id' ] ) ; $ this -> changePasswordForUserById ( ( int ) $ userData [ 'id' ] , $ newPassword ) ; }
Changes the password for the user with the given username

@param string $username the username of the user whose password to change
@param string $newPassword the new password to set
@throws UnknownUsernameException if no user with the specified username has been found
@throws AmbiguousUsernameException if multiple users with the specified username have been found
@throws InvalidPasswordException if the desired new password has been invalid
@throws AuthError if an internal problem occurred (do *not* catch)
Changes the password for the user with the given username