8000 minor #28483 [HttpFoundation] don't override StreamedResponse::setNot… · symfony/symfony@a9004b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit a9004b3

Browse files
committed
minor #28483 [HttpFoundation] don't override StreamedResponse::setNotModified() (nicolas-grekas)
This PR was merged into the 2.8 branch. Discussion ---------- [HttpFoundation] don't override StreamedResponse::setNotModified() | Q | A | ------------- | --- | Branch? | 2.8 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Alternative implementation to #27937, because `Response::setNotModified()` has been made final in 4.0 so we shouldn't override it. Commits ------- 9ef7f70 [HttpFoundation] don't override StreamedResponse::setNotModified()
2 parents 8d90df7 + 9ef7f70 commit a9004b3

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/Symfony/Component/HttpFoundation/StreamedResponse.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ public function setContent($content)
123123
if (null !== $content) {
124124
throw new \LogicException('The content cannot be set on a StreamedResponse instance.');
125125
}
126+
127+
$this->streamed = true;
126128
}
127129

128130
/**
@@ -134,16 +136,4 @@ public function getContent()
134136
{
135137
return false;
136138
}
137-
138-
/**
139-
* {@inheritdoc}
140-
*
141-
* @return $this
142-
*/
143-
public function setNotModified()
144-
{
145-
$this->setCallback(function () {});
146-
147-
return parent::setNotModified();
148-
}
149139
}

0 commit comments

Comments
 (0)
0