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

Breadcrumb

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

function StreamedResponse::setContent

Return value

$this

Throws

\LogicException when the content is not null

Overrides Response::setContent

File

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

Class

StreamedResponse
StreamedResponse represents a streamed HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function setContent(?string $content) : static {
    if (null !== $content) {
        throw new \LogicException('The content cannot be set on a StreamedResponse instance.');
    }
    $this->streamed = true;
    return $this;
}

API Navigation

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