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
-------
9ef7f7038d
[HttpFoundation] don't override StreamedResponse::setNotModified()
This commit is contained in:
commit
a9004b3208
@ -123,6 +123,8 @@ class StreamedResponse extends Response
|
||||
if (null !== $content) {
|
||||
throw new \LogicException('The content cannot be set on a StreamedResponse instance.');
|
||||
}
|
||||
|
||||
$this->streamed = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -134,16 +136,4 @@ class StreamedResponse extends Response
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setNotModified()
|
||||
{
|
||||
$this->setCallback(function () {});
|
||||
|
||||
return parent::setNotModified();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user