You are here

public function StreamedResponse::setCallback in Zircon Profile 8

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

Sets the PHP callback associated with this Response.

Parameters

callable $callback A valid PHP callback:

Throws

\LogicException

1 call to StreamedResponse::setCallback()
StreamedResponse::__construct in vendor/symfony/http-foundation/StreamedResponse.php
Constructor.

File

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

Class

StreamedResponse
StreamedResponse represents a streamed HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function setCallback($callback) {
  if (!is_callable($callback)) {
    throw new \LogicException('The Response callback must be a valid PHP callable.');
  }
  $this->callback = $callback;
}