Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7799881

Browse filesBrowse files
committed
minor #24374 [HttpFoundation] Return instance in StreamedResponse (abellion)
This PR was squashed before being merged into the 3.4 branch (closes #24374). Discussion ---------- [HttpFoundation] Return instance in StreamedResponse | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT <!-- - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the 3.4, legacy code removals go to the master branch. - Please fill in this template according to the PR you're about to submit. - Replace this comment by a description of what your PR is solving. --> Commits ------- 2080582 [HttpFoundation] Return instance in StreamedResponse
2 parents cd91b8f + 2080582 commit 7799881
Copy full SHA for 7799881

File tree

1 file changed

+15
-1
lines changed
Filter options

1 file changed

+15
-1
lines changed

‎src/Symfony/Component/HttpFoundation/StreamedResponse.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/StreamedResponse.php
+15-1Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,22 @@ public static function create($callback = null, $status = 200, $headers = array(
6666
* Sets the PHP callback associated with this Response.
6767
*
6868
* @param callable $callback A valid PHP callback
69+
*
70+
* @return $this
6971
*/
7072
public function setCallback(callable $callback)
7173
{
7274
$this->callback = $callback;
75+
76+
return $this;
7377
}
7478

7579
/**
7680
* {@inheritdoc}
7781
*
7882
* This method only sends the headers once.
83+
*
84+
* @return $this
7985
*/
8086
public function sendHeaders()
8187
{
@@ -85,13 +91,15 @@ public function sendHeaders()
8591

8692
$this->headersSent = true;
8793

88-
parent::sendHeaders();
94+
return parent::sendHeaders();
8995
}
9096

9197
/**
9298
* {@inheritdoc}
9399
*
94100
* This method only sends the content once.
101+
*
102+
* @return $this
95103
*/
96104
public function sendContent()
97105
{
@@ -106,18 +114,24 @@ public function sendContent()
106114
}
107115

108116
call_user_func($this->callback);
117+
118+
return $this;
109119
}
110120

111121
/**
112122
* {@inheritdoc}
113123
*
114124
* @throws \LogicException when the content is not null
125+
*
126+
* @return $this
115127
*/
116128
public function setContent($content)
117129
{
118130
if (null !== $content) {
119131
throw new \LogicException('The content cannot be set on a StreamedResponse instance.');
120132
}
133+
134+
return $this;
121135
}
122136

123137
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.