YoastSEO_Vendor\GuzzleHttp\Psr7
Response::__construct() public Yoast 1.0
{} Это метод класса: Response{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$Response = new Response(); $Response->__construct( $status, $headers, $body, $version, $reason );
- $status(число)
- Status code
По умолчанию: 200 - $headers(массив)
- Response headers
По умолчанию: [] - $body(строка/null/resource/Streamчислоerface)
- Response body
По умолчанию: null - $version(строка)
- Protocol version
По умолчанию: '1.1' - $reason(строка/null)
- Reason phrase (when empty a default will be used based on the status code)
По умолчанию: null
Код Response::__construct() Response:: construct Yoast 15.6.2
public function __construct($status = 200, array $headers = [], $body = null, $version = '1.1', $reason = null)
{
if (\filter_var($status, \FILTER_VALIDATE_INT) === \false) {
throw new \InvalidArgumentException('Status code must be an integer value.');
}
$this->statusCode = (int) $status;
if ($body !== '' && $body !== null) {
$this->stream = stream_for($body);
}
$this->setHeaders($headers);
if ($reason == '' && isset(self::$phrases[$this->statusCode])) {
$this->reasonPhrase = self::$phrases[$this->statusCode];
} else {
$this->reasonPhrase = (string) $reason;
}
$this->protocol = $version;
}