Returns an instance with the specified status code and, optionally, reason phrase.

@param int $status
@param string $reasonPhrase
@return static
@throws InvalidArgumentException
776787
public function withStatus($status, $reasonPhrase = '')
        {
            $status = $this->filterStatus($status);
            $reasonPhrase = $this->filterReasonPhrase($status, $reasonPhrase);

            $clone = clone $this;
            $clone->status = $status;
            $clone->reasonPhrase = $reasonPhrase;
            return $clone;
        }
630528
protected function _setStatus($code, $reasonPhrase = '')
    {
        if (!isset($this->_statusCodes[$code])) {
            throw new InvalidArgumentException(sprintf(
                'Invalid status code: %s. Use a valid HTTP status code in range 1xx - 5xx.',
                $code
            ));
        }

        $this->_status = $code;
        if (empty($reasonPhrase)) {
            $reasonPhrase = $this->_statusCodes[$code];
        }
        $this->_reasonPhrase = $reasonPhrase;
        $this->_setContentType();
    }
947300
private function logStatusChange( $status, $reason = null )
    {
        $contentObjectId = $this->version()->attribute( 'contentobject_id' );
        $versionNumber = $this->version()->attribute( 'version' );
        eZDebugSetting::writeDebug(
            'kernel-content-publish',
            sprintf(
                "process #%d, content %d.%d, status changed to %s (reason: %s)",
                $this->attribute( 'ezcontentobject_version_id' ),
                $contentObjectId,
                $versionNumber,
                $this->getStatusString( $status ),
                $reason ?: "none given"
            ),
            'Asynchronous publishing process status changed'
        );
    }
265010
public function status($status)
  {
    if (is_string($status)) {
      switch ($status) {
        case 'success':
          $this->status = JSendResponse::STATUS_SUCCESS;
          break;
        case 'error':
          $this->status = JSendResponse::STATUS_ERROR;
          break;
        case 'fail':
          $this->status = JSendResponse::STATUS_FAIL;
          break;
        default:
          throw new \InvalidArgumentException("Unable to parse status '${status}'");
      }
    } else {
      $this->status = $status;
    }

    return $this;
  }
864436
public function getReasonPhrase()
    {
        if ($this->reason_phrase) {
            return $this->reason_phrase;
        }

        return \Owl\Http::getStatusPhrase($this->code);
    }
621343
public function withStatus($code, $reasonPhrase = '')
    {
        $this->code = (int) $code;
        $this->reason_phrase = $reasonPhrase;

        return $this;
    }
6575
public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface
    {
        $response = new Response('php://memory', $code, []);
        $response = $response->withStatus($code, $reasonPhrase);

        foreach ($this->config->baseHeaders() as $header => $value) {
            $response = $response->withAddedHeader($header, $value);
        }

        return $response;
    }
901235
public function setStatus($code, $reasonPhrase = null)
    {
        $this->statusCode   = $code;
        $this->reasonPhrase = $reasonPhrase;
    }
110286
public function withStatus($code, $reasonPhrase = '')
    {
        if (! isset($this->statusTexts[$code])) {
            throw new \InvalidArgumentException("Invalid status code. [{$code}]");
        }

        $this->statusCode   = $code;
        $this->reasonPhrase = $reasonPhrase ?: $this->statusTexts[$code];

        return $this;
    }
498390
public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface
  {
    $response = new Response($code);

    \logger()->debug('Created PSR-7 Response (Guzzle)');

    return $response;
  }
402159
public function setStatus($status)
    {
        $allowedValues = $this->getStatusAllowableValues();
        if (!in_array($status, $allowedValues, true)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'status', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['status'] = $status;

        return $this;
    }
921414
public function withStatus($code, $reasonPhrase = '')
    {
        if (!is_string($reasonPhrase) && !method_exists($reasonPhrase, '__toString')) {
            throw new InvalidArgumentException('ReasonPhrase must be a string');
        }

        $clone = clone $this;
        $clone->statusCode = $code;
        if ($reasonPhrase === '' && isset(Header::$messages[$code])) {
            $reasonPhrase = Header::$messages[$code];
        }

        $clone->reasonPhrase = $reasonPhrase;

        return $clone;
    }
241151
public function setStatus($status)
    {
        if ($status !== self::STATUS_UP && $status !== self::STATUS_DOWN) {
            $message = "Value '%s' must be ".self::STATUS_UP.' or '.self::STATUS_DOWN;
            throw new \InvalidArgumentException(sprintf($message, $status));
        }

        $this->status = $status;

        return $this;
    }
901268
public function withStatus($code, $reasonPhrase = null)
    {
        if ($this->complete) {
            return $this;
        }

        $new = $this->psrResponse->withStatus($code, $reasonPhrase);
        return new self($new);
    }
1184623
public function setStatus($code, $reasonPhrase = '')
    {
        $codeGroup = ResponseCode::getGroupFromCode($code);

        if ($codeGroup !== ResponseCode::GROUP_CLIENT_ERROR && $codeGroup !== ResponseCode::GROUP_SERVER_ERROR) {
            throw new \LogicException(__CLASS__ . ' accepts error codes only (4xx & 5xx).');
        }

        parent::setStatus($code, $reasonPhrase);
    }
922851
protected function setStatus($code, $reasonPhrase)
    {
        $this->assertHeadersNotSent();

        parent::setStatus($code, $reasonPhrase);
        
        $this->sendStatusHeader();
    }
714453
public function getReasonPhrase()
    {
        if (isset(static::$messages[$this->status]) === true) {
            return static::$messages[$this->status];
        }

        return null;
    }