/** * Set the HTTP status code for the response. * * @param int $statusCode * @return self * @throws \InvalidArgumentException */ public function setStatus(int $statusCode) : ResponseBuilder { if ($statusCode < 400 || $statusCode >= 600) { throw new InvalidArgumentException("{$statusCode} is not a valid error HTTP status code."); } return parent::setStatus($statusCode); }