*/ public $headers = array(); /** * Beginning of the response body (GET requests only; capped). * * @var string */ public $body = ''; /** * Total time spent in milliseconds. * * @var int */ public $response_ms = 0; /** * Redirect chain: each hop as [url, status code]. * * @var array */ public $chain = array(); /** * HTTP method used for the final attempt. * * @var string */ public $method = 'HEAD'; /** * Build a response for a successful status without a network request (internal fast path). * * @param string $url URL. * @param string $message Note stored as the error message column. */ public static function verified( string $url, string $message ): self { $r = new self(); $r->code = 200; $r->final_url = $url; $r->error_message = $message; $r->method = 'NONE'; return $r; } /** * Header value ('' if absent). * * @param string $name Header name (any case). */ public function header( string $name ): string { $name = strtolower( $name ); return $this->headers[ $name ] ?? ''; } }