httpCode = $code; $this->content = $content; try { $decoded = \json_decode($content, TRUE, 512, JSON_THROW_ON_ERROR); $this->errCode = $decoded['errcode'] ?? NULL; } catch (\JsonException) { $this->errCode = NULL; } } /** * @return int */ public function getHttpCode(): int { return $this->getCode(); } /** * @return string */ public function getContent(): string { return $this->content; } }