src/UserManager.php
protected function updatePasswordInternal($userId, $newPassword) {
		$newPassword = \password_hash($newPassword, \PASSWORD_DEFAULT);

		try {
			$affected = $this->db->update(
				$this->makeTableNameComponents('users'),
				[ 'password' => $newPassword ],
				[ 'id' => $userId ]
			);

			if ($affected === 0) {
				throw new UnknownIdException();
			}
		}
		catch (Error $e) {
			throw new DatabaseError($e->getMessage());
		}
	}
protected function updatePasswordInternal($userId, $newPassword) {
		$newPassword = \password_hash($newPassword, \PASSWORD_DEFAULT);

		try {
			$affected = $this->db->update(
				$this->makeTableNameComponents('users'),
				[ 'password' => $newPassword ],
				[ 'id' => $userId ]
			);

			if ($affected === 0) {
				throw new UnknownIdException();
			}
		}
		catch (Error $e) {
			throw new DatabaseError($e->getMessage());
		}
	}
protected function updatePasswordInternal ( $ userId , $ newPassword ) { $ newPassword = \ password_hash ( $ newPassword , \ PASSWORD_DEFAULT ) ; try { $ affected = $ this -> db -> update ( $ this -> makeTableNameComponents ( 'users' ) , [ 'password' => $ newPassword ] , [ 'id' => $ userId ] ) ; if ( $ affected === 0 ) { throw new UnknownIdException ( ) ; } } catch ( Error $ e ) { throw new DatabaseError ( $ e -> getMessage ( ) ) ; } }
Updates the given user's password by setting it to the new specified password

@param int $userId the ID of the user whose password should be updated
@param string $newPassword the new password
@throws UnknownIdException if no user with the specified ID has been found
@throws AuthError if an internal problem occurred (do *not* catch)
Updates the given user s password by setting it to the new specified password