@param int    $code
@param string $reasonPhrase

@return ResponseInterface
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;
    }
660497
protected function filterStatusCode($code)
    {
        $code = filter_var($code, FILTER_VALIDATE_INT, ['options' => [
            'min_range' => self::MINIMUM,
            'max_range' => self::MAXIMUM,
        ]]);
        if (!$code) {
            throw new InvalidArgumentException(
                'The submitted code must be a positive integer between '.self::MINIMUM.' and '.self::MAXIMUM
            );
        }

        return $code;
    }
525092
public function setReasonPhrase($reasonPhrase)
    {
        if (is_string($reasonPhrase)) {
            $this->reasonPhrase = $reasonPhrase;
        } else {
            throw new HTTPException(
                sprintf('Reason phrase must be a string; %s provided', gettype($reasonPhrase))
            );
        }

        return $this;
    }
506277
public function getResponse(int $code): Response
    {
        if (!isset($this->responses[$code])) {
            if (isset($this->responses[0])) {
                // Return default response
                return $this->responses[0];
            }
            throw new \InvalidArgumentException(
                "Operation '{$this->getId()}' does not have a definition for status '$code'" .
                " (has " . implode(', ', array_keys($this->responses)) . ')'
            );
        }

        return $this->responses[$code];
    }
879314
protected function createRedirectCodeResponse(TokenInterface $code, string $state = null): ResponseInterface
    {
        $this->logDebug('Sending code as redirect response.');

        // for access token format @link https://tools.ietf.org/html/rfc6749#section-4.1.3
        $parameters = $this->filterNulls([
            'code'  => $code->getCode(),
            'state' => $state,
        ]);

        $redirectUri = $code->getRedirectUriString();
        $query       = $this->encodeAsXWwwFormUrlencoded($parameters);

        $response = new RedirectResponse((new Uri($redirectUri))->withQuery($query));

        return $response;
    }
324265
public function setStatus($code, $reasonPhrase = null)
    {
        $this->code = (int) $code;

        if ($reasonPhrase !== null) {
            $this->reasonPhrase = $reasonPhrase;
        } elseif (isset(Http::$codes[$this->code])) {
            $this->reasonPhrase = Http::$codes[$this->code];
        }
    }
635310
public function show($code)
    {
        $lang = $this->langRepo->getByCode($code);
        if (empty($lang)) {
            return $this->respondNotFound();
        }
        return $this->respondWithSuccess($lang, new LangTransformer);
    }
229956
public static function toMessage($code)
    {
        return isset(self::$message[$code]) ? self::$message[$code] : $code;
    }
255990
protected function createErrorResponse($code)
    {
        $response = new HTTPResponse('', $code);

        // Show message in dev
        if (!Director::isLive()) {
            $response->setBody($response->getStatusDescription());
        }

        return $response;
    }
556703
public static function getReason($code, $default = NULL)
	{
		$code = (int)$code;
		
		if(array_key_exists($code, static::$reason))
		{
			return static::$reason[$code];
		}
		
		return $default;
	}
49853
public static function getText($code)
    {
        $code = (int) $code;

        if (!self::exists($code)) {
            throw new \DomainException('Http Code does not exist!');
        }

        return self::$httpCodes[$code];
	}
1335684
function status($code) {
		$reason=@constant('self::HTTP_'.$code);
		if (PHP_SAPI!='cli')
			header($_SERVER['SERVER_PROTOCOL'].' '.$code.' '.$reason);
		return $reason;
	}
1305403
public function setStatusCode($code)
    {
        // set status code
        $this->statusCode = $code;

        // lookup reason phrase by code and set
        $this->setStatusReasonPhrase(HttpProtocol::getStatusReasonPhraseByCode($code));
    }
594933
public function getResponse($responseCode)
    {
        return isset($this->responses[$responseCode]) ? $this->responses[$responseCode] : null;
    }
489478
public void setStatus(int statusCode, String reasonPhrase) {
		try {
			final Response response = getResponse();
			response.setStatusCode(statusCode);
			response.setReasonPhrase(reasonPhrase);
		} catch (ParseException e) {
			throw new IllegalArgumentException(e);
		}

	}
1010148
public function readByCode(string $code, int $expirationInSeconds): ?TokenInterface
    {
        $schema = $this->getDatabaseSchema();
        return $this->readEnabledTokenByColumnWithExpirationCheck(
            $code,
            $schema->getTokensCodeColumn(),
            $expirationInSeconds,
            $schema->getTokensCodeCreatedAtColumn()
        );
    }
631805
public function getReasonPhrase()
    {
        $code = $this->getStatusCode();

        if ($this->reasonPhrase === null && isset($this->phrases[$code]))
        {
            return $this->phrases[$code];
        }

        return (string) $this->reasonPhrase;
    }