statusCode = (int) $statusCode; $this->errorCode = (string) $errorCode; $this->data = $data; $this->headers = $headers; // Mirror the status into Exception's $code so getCode() also returns // it. Preserves BC for plugins that read the status via the deprecated // shims' inherited getCode() before this hierarchy existed // (e.g. `new ForbiddenException($msg, 403)` → `$e->getCode() === 403`). // getStatusCode() remains the authoritative accessor. parent::__construct((string) $message, (int) $statusCode, $previous); } /** * @return int */ public function getStatusCode() { return $this->statusCode; } /** * @return string */ public function getErrorCode() { return $this->errorCode; } /** * @return array */ public function getData() { return $this->data; } /** * @return array */ public function getHeaders() { return $this->headers; } }