You are here

public function StreamedResponse::sendContent in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/StreamedResponse.php \Symfony\Component\HttpFoundation\StreamedResponse::sendContent()

This method only sends the content once.

Overrides Response::sendContent

File

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

Class

StreamedResponse
StreamedResponse represents a streamed HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function sendContent() {
  if ($this->streamed) {
    return;
  }
  $this->streamed = true;
  if (null === $this->callback) {
    throw new \LogicException('The Response callback must not be null.');
  }
  call_user_func($this->callback);
}