userId = (int)$this->getUrlParamInt('userId'); } public function handle(): void { if (!$this->isUserLoggedIn()) { return; } parent::handle(); if (!$this->hasUserPermission($this->userId)) { return; } try { $user = new User($this->userId); $this->response->setParameter('email', $user->getEmail()); } catch (Throwable $e) { $this->response->setParameter('success', false); $this->response->setMessage($e->getMessage()); $this->response->setStatus($e->getCode() !== 0 ? $e->getCode() : ServerStatus::BAD_REQUEST); } } }