Skip to content

Commit

Permalink
⬆️ Symfony 6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
giggsey committed Feb 9, 2022
1 parent 2761a4c commit 3d86367
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
],
"minimum-stability": "stable",
"require": {
"symfony/http-foundation": "^2.4|^3.0|^4.1|^5.0",
"php": ">=8.0",
"symfony/http-foundation": "^6.0",
"psr/http-message": "^1.0"
},
"autoload": {
Expand Down
10 changes: 6 additions & 4 deletions src/PSR7StreamResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function setContentDisposition($disposition, $filename)
/**
* {@inheritdoc}
*/
public function prepare(Request $request)
public function prepare(Request $request): static
{
$this->headers->set('Content-Length', $this->stream->getSize());

Expand Down Expand Up @@ -158,7 +158,7 @@ private function hasValidIfRangeHeader($header)
*
* {@inheritdoc}
*/
public function sendContent()
public function sendContent(): static
{
if (!$this->isSuccessful()) {
return parent::sendContent();
Expand All @@ -185,19 +185,21 @@ public function sendContent()
*
* @throws \LogicException when the content is not null
*/
public function setContent($content)
public function setContent($content): static
{
if (null !== $content) {
throw new \LogicException('The content cannot be set on a PSR7StreamResponse instance.');
}

return $this;
}

/**
* {@inheritdoc}
*
* @return false
*/
public function getContent()
public function getContent(): string|false
{
return false;
}
Expand Down

0 comments on commit 3d86367

Please sign in to comment.