Skip to content

Commit

Permalink
Merge pull request #20 from ebln/liberal72
Browse files Browse the repository at this point in the history
Unstricten dependencies and reintroducted deprecated stream_for
  • Loading branch information
ebln committed Jul 10, 2021
2 parents 84158e0 + 7060224 commit 7a07c72
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
},
"require": {
"guzzlehttp/psr7": "^1.8",
"guzzlehttp/psr7": "~1.6.1",
"php": "^7.2",
"webmozart/assert": "^1.6"
},
Expand Down
31 changes: 16 additions & 15 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Adapter/CommonAdapterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace brnc\Symfony1\Message\Adapter;

use brnc\Symfony1\Message\Utillity\Assert;
use GuzzleHttp\Psr7\Utils;
use function GuzzleHttp\Psr7\stream_for;
use Psr\Http\Message\StreamInterface;

/**
Expand Down Expand Up @@ -83,7 +83,7 @@ public function withHeader($name, $value)
*/
public function getBody(): StreamInterface
{
return $this->body ?? Utils::streamFor();
return $this->body ?? stream_for();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Adapter/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
use brnc\Symfony1\Message\Utillity\Assert;
use GuzzleHttp\Psr7\CachingStream;
use GuzzleHttp\Psr7\LazyOpenStream;
use function GuzzleHttp\Psr7\stream_for;
use GuzzleHttp\Psr7\UploadedFile;
use GuzzleHttp\Psr7\Uri;
use GuzzleHttp\Psr7\Utils;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\StreamInterface;
use Psr\Http\Message\UriInterface;
Expand Down Expand Up @@ -107,7 +107,7 @@ public static function fromSfWebRequest(\sfWebRequest $sfWebRequest, array $opti
$content = $sfWebRequest->getContent();
if (false !== $content) {
// lazy init, as getBody() defaults properly to an empty body using stream_for()
$new->body = Utils::streamFor($content);
$new->body = stream_for($content);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Adapter/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace brnc\Symfony1\Message\Adapter;

use brnc\Symfony1\Message\Utillity\Assert;
use GuzzleHttp\Psr7\Utils;
use function GuzzleHttp\Psr7\stream_for;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;
use ReflectionObject;
Expand Down Expand Up @@ -225,7 +225,7 @@ public function getBody(): StreamInterface
{
if (!$this->body || !$this->body->isReadable()) {
// Refresh from adapted sfWebRequest if stream is missing or stale
$this->body = Utils::streamFor($this->sfWebResponse->getContent());
$this->body = stream_for($this->sfWebResponse->getContent());
}

return $this->body;
Expand Down

0 comments on commit 7a07c72

Please sign in to comment.