Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. StreamedResponse.php

function StreamedResponse::sendHeaders

This method only sends the headers once.

Parameters

positive-int|null $statusCode The status code to use, override the statusCode property if set and not null:

Return value

$this

Overrides Response::sendHeaders

File

vendor/symfony/http-foundation/StreamedResponse.php, line 76

Class

StreamedResponse
StreamedResponse represents a streamed HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function sendHeaders(?int $statusCode = null) : static {
    if ($this->headersSent) {
        return $this;
    }
    if ($statusCode < 100 || $statusCode >= 200) {
        $this->headersSent = true;
    }
    return parent::sendHeaders($statusCode);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal