X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fsymfony%2Fhttp-foundation%2FStreamedResponse.php;fp=vendor%2Fsymfony%2Fhttp-foundation%2FStreamedResponse.php;h=92868d33e48144666e7a49e4ce00377079aa82f5;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=928531309ad0a5bcf7beaa6da9dc4639b320d327;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/symfony/http-foundation/StreamedResponse.php b/vendor/symfony/http-foundation/StreamedResponse.php index 928531309..92868d33e 100644 --- a/vendor/symfony/http-foundation/StreamedResponse.php +++ b/vendor/symfony/http-foundation/StreamedResponse.php @@ -31,8 +31,6 @@ class StreamedResponse extends Response private $headersSent; /** - * Constructor. - * * @param callable|null $callback A valid PHP callback or null to set it later * @param int $status The response status code * @param array $headers An array of response headers @@ -66,37 +64,45 @@ class StreamedResponse extends Response * Sets the PHP callback associated with this Response. * * @param callable $callback A valid PHP callback + * + * @return $this */ public function setCallback(callable $callback) { $this->callback = $callback; + + return $this; } /** * {@inheritdoc} * * This method only sends the headers once. + * + * @return $this */ public function sendHeaders() { if ($this->headersSent) { - return; + return $this; } $this->headersSent = true; - parent::sendHeaders(); + return parent::sendHeaders(); } /** * {@inheritdoc} * * This method only sends the content once. + * + * @return $this */ public function sendContent() { if ($this->streamed) { - return; + return $this; } $this->streamed = true; @@ -106,18 +112,24 @@ class StreamedResponse extends Response } call_user_func($this->callback); + + return $this; } /** * {@inheritdoc} * * @throws \LogicException when the content is not null + * + * @return $this */ public function setContent($content) { if (null !== $content) { throw new \LogicException('The content cannot be set on a StreamedResponse instance.'); } + + return $this; } /**