-
Notifications
You must be signed in to change notification settings - Fork 50
Allow PHP 8 #389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Allow PHP 8 #389
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
58b269c
Allow PHP 8
ddeboer c83ef6f
Try 8.0snapshot
ddeboer de49841
Test against stable deps
ddeboer 7381ea5
Fix assertions
ddeboer 0c7e39e
Update to guzzle7-adapter
ddeboer 8e448fc
Update changelog
ddeboer 7ccaee7
Revert "Update changelog"
ddeboer 068cd2e
Revert "Update to guzzle7-adapter"
ddeboer b2808bc
Support both guzzle6 and guzzle7-adapter
ddeboer e29f2c7
Handle error in PHP < 8
ddeboer 698e23a
Require PHP 7.3
ddeboer fe68d49
Test guzzle7-adapter only
ddeboer 032708a
Install Guzzle adapter on demand
ddeboer 9736aaa
Install an adapter before running the tests
ddeboer a62c104
No snapshot
ddeboer 5e3be8f
Install adapter
ddeboer 1376777
Always install psr7 lib
ddeboer 89e908b
Install adapter
ddeboer 6e33bdb
Re-add guzzle6-adapter
ddeboer 2439306
Use guzzle6-adapter
ddeboer aed21dd
Try guzzle7-adapter
ddeboer 0534d1d
Remove outdated fix
ddeboer de70519
Fix message
ddeboer 740270e
Skip some tests
ddeboer da71239
Skip some more tests
ddeboer bcdeed5
Use guzzle6 for lowest
ddeboer f196f00
Skip test
ddeboer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Http\HttplugBundle\ClientFactory; | ||
|
||
use Http\Adapter\Guzzle7\Client; | ||
|
||
/** | ||
* @author Tobias Nyholm <tobias.nyholm@gmail.com> | ||
*/ | ||
class Guzzle7Factory implements ClientFactory | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function createClient(array $config = []) | ||
{ | ||
if (!class_exists('Http\Adapter\Guzzle7\Client')) { | ||
throw new \LogicException('To use the Guzzle7 adapter you need to install the "php-http/guzzle7-adapter" package.'); | ||
} | ||
|
||
return Client::createWithConfig($config); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Http\HttplugBundle\Tests\Unit\ClientFactory; | ||
|
||
use Http\Adapter\Guzzle7\Client; | ||
use Http\HttplugBundle\ClientFactory\Guzzle7Factory; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* @author Tobias Nyholm <tobias.nyholm@gmail.com> | ||
*/ | ||
class Guzzle7FactoryTest extends TestCase | ||
{ | ||
public function testCreateClient(): void | ||
{ | ||
if (!class_exists(Client::class)) { | ||
$this->markTestSkipped('Guzzle7 adapter is not installed'); | ||
} | ||
|
||
$factory = new Guzzle7Factory(); | ||
$client = $factory->createClient(); | ||
|
||
$this->assertInstanceOf(Client::class, $client); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.