Flugg\Responder\Http\ResponseBuilder::setStatus PHP Метод

setStatus() публичный Метод

Set the HTTP status code for the response.
public setStatus ( integer $statusCode ) : ResponseBuilder
$statusCode integer
Результат ResponseBuilder
    public function setStatus(int $statusCode) : ResponseBuilder
    {
        $this->statusCode = $statusCode;
        return $this;
    }

Usage Example

 /**
  * 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);
 }