userId = (int)$this->getUrlParamInt('userId'); } public function handle(): void { $user = new User($this->userId); try { $this->response = new ApiJsonResponse(); $this->response->setParameter('sharings', $user->getSharings()); } catch (Throwable $e) { $this->response = new ApiJsonResponse($e->getCode() !== 0 ? $e->getCode() : ServerStatus::BAD_REQUEST); $this->response->setSuccess(false); $this->response->setMessage($e->getMessage()); } } }