You are here

public function HttpResponse::setStatusCode in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-feed/src/PubSubHubbub/HttpResponse.php \Zend\Feed\PubSubHubbub\HttpResponse::setStatusCode()

Set HTTP response code to use with headers

Parameters

int $code:

Return value

HttpResponse

Throws

Exception\InvalidArgumentException

File

vendor/zendframework/zend-feed/src/PubSubHubbub/HttpResponse.php, line 155

Class

HttpResponse

Namespace

Zend\Feed\PubSubHubbub

Code

public function setStatusCode($code) {
  if (!is_int($code) || 100 > $code || 599 < $code) {
    throw new Exception\InvalidArgumentException('Invalid HTTP response' . ' code:' . $code);
  }
  $this->statusCode = $code;
  return $this;
}