/** * Delete an user. * Should be run by logged user or admin. * * @param string $username * * @return ApiResponse * * @throws NotFoundHttpException if user does not exists. */ public function deleteUser($username) { try { $this->api->deleteUser($username); } catch (UserNotFoundException $e) { throw new NotFoundHttpException('Delete action failed: user ' . $username . ' not found.', $e); } return new ApiResponse(true); }