/** * This method will enforce that the status code will always be in the 200 range. * * @param $status */ public function setStatusCode($status, $text = null) { if ($status < 200 || $status > 299) { throw new \Exception('Success operations should have a 2xx status code.'); } parent::setStatusCode($status, $text); }
/** * This method will enforce that the status code will always be in the >= 400 range. * * @param $status */ public function setStatusCode($status, $text = null) { if ($status < 400) { throw new Exception('Error operations should have a status code in the 4xx or 5xx range.'); } parent::setStatusCode($status, $text); }