Skip to content

Commit

Permalink
Merge pull request #26 from ebln/prep-gzzl-psr-upd
Browse files Browse the repository at this point in the history
Add support for GuzzleHttp\Psr7 ^2 (Release 1.3.2)
  • Loading branch information
ebln committed Jul 10, 2021
2 parents bcf0e76 + 9d35659 commit d4d1fa7
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
},
"require": {
"guzzlehttp/psr7": "^1.7",
"guzzlehttp/psr7": "^1.7 || ^2.0",
"php": "^7.4 || ^8.0",
"webmozart/assert": "^1.6"
},
Expand All @@ -36,7 +36,7 @@
"psr-4": {
"brnc\\Tests\\Symfony1\\Message\\": "tests/"
},
"files": ["mock/sfWebRequest.php", "mock/sfWebResponse.php", "mock/sfEventDispatcher.php", "mock/sfEvent.php"]
"files": ["mock/sfWebRequest.php", "mock/sfWebResponse.php", "mock/sfEventDispatcher.php", "mock/sfEvent.php", "mock/guzzle-psr7/function_include.php"]
},
"scripts": {
"phpunit": "phpunit --coverage-html coverage --coverage-text --colors=auto",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

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

14 changes: 14 additions & 0 deletions mock/guzzle-psr7/function_include.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

/*
* TODO remove this and the whole directory once php-http/psr7-integration-tests
* supports GuzzleHttp\Psr7 ^2
*
* Sadly needed as php-http/psr7-integration-tests @ 1.1.1
* relies on the deprecated GuzzleHttp\Psr7::stream_for instead of Utils::streamFor
*/
if (!function_exists('GuzzleHttp\Psr7\stream_for')) {
require __DIR__ . '/stream_for.php';
}
15 changes: 15 additions & 0 deletions mock/guzzle-psr7/stream_for.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace GuzzleHttp\Psr7;

/*
* TODO remove this and the whole directory once php-http/psr7-integration-tests
* supports GuzzleHttp\Psr7 ^2
*
* Sadly needed as php-http/psr7-integration-tests @ 1.1.1
* relies on the deprecated GuzzleHttp\Psr7::stream_for instead of Utils::streamFor
*/
function stream_for($resource = '', array $options = [])
{
return \GuzzleHttp\Psr7\Utils::streamFor($resource, $options);
}

0 comments on commit d4d1fa7

Please sign in to comment.