File tree Expand file tree Collapse file tree 12 files changed +27
-26
lines changed Expand file tree Collapse file tree 12 files changed +27
-26
lines changed Original file line number Diff line number Diff line change 42
42
"symfony/options-resolver" : " ^3.4.34 || ^4.2.12 || ^5.0"
43
43
},
44
44
"conflict" : {
45
+ "php-http/guzzle6-adapter" : " <1.1" ,
45
46
"php-http/curl-client" : " <2.0"
46
47
},
47
48
"require-dev" : {
48
49
"matthiasnoback/symfony-dependency-injection-test" : " ^4.0" ,
49
50
"nyholm/nsa" : " ^1.1" ,
50
51
"nyholm/psr7" : " ^1.2.1" ,
51
52
"php-http/cache-plugin" : " ^1.7" ,
52
- "php-http/guzzle7 -adapter" : " ^0.1 .1" ,
53
+ "php-http/guzzle6 -adapter" : " ^1.1.1 || ^2.0 .1" ,
53
54
"php-http/mock-client" : " ^1.2" ,
54
55
"php-http/promise" : " ^1.0" ,
55
56
"polishsymfonycommunity/symfony-mocker-container" : " ^1.0" ,
Original file line number Diff line number Diff line change 4
4
5
5
namespace Http \HttplugBundle \ClientFactory ;
6
6
7
- use Http \Adapter \Guzzle7 \Client ;
7
+ use Http \Adapter \Guzzle6 \Client ;
8
8
9
9
/**
10
10
* @author Tobias Nyholm <[email protected] >
11
11
*/
12
- class Guzzle7Factory implements ClientFactory
12
+ class Guzzle6Factory implements ClientFactory
13
13
{
14
14
/**
15
15
* {@inheritdoc}
16
16
*/
17
17
public function createClient (array $ config = [])
18
18
{
19
- if (!class_exists ('Http\Adapter\Guzzle7 \Client ' )) {
20
- throw new \LogicException ('To use the Guzzle7 adapter you need to install the "php-http/guzzle7 -adapter" package. ' );
19
+ if (!class_exists ('Http\Adapter\Guzzle6 \Client ' )) {
20
+ throw new \LogicException ('To use the Guzzle6 adapter you need to install the "php-http/guzzle6 -adapter" package. ' );
21
21
}
22
22
23
23
return Client::createWithConfig ($ config );
Original file line number Diff line number Diff line change 66
66
<argument type =" service" id =" httplug.collector.formatter" />
67
67
<argument type =" service" id =" debug.stopwatch" />
68
68
</service >
69
- <service id =" httplug.collector.factory.guzzle7 " class =" Http\HttplugBundle\Collector\ProfileClientFactory" decorates =" httplug.factory.guzzle7 " public =" false" >
70
- <argument type =" service" id =" httplug.collector.factory.guzzle7 .inner" />
69
+ <service id =" httplug.collector.factory.guzzle6 " class =" Http\HttplugBundle\Collector\ProfileClientFactory" decorates =" httplug.factory.guzzle6 " public =" false" >
70
+ <argument type =" service" id =" httplug.collector.factory.guzzle6 .inner" />
71
71
<argument type =" service" id =" httplug.collector.collector" />
72
72
<argument type =" service" id =" httplug.collector.formatter" />
73
73
<argument type =" service" id =" debug.stopwatch" />
Original file line number Diff line number Diff line change 89
89
<service id =" httplug.factory.guzzle5" class =" Http\HttplugBundle\ClientFactory\Guzzle5Factory" public =" false" >
90
90
<argument type =" service" id =" httplug.message_factory" />
91
91
</service >
92
- <service id =" httplug.factory.guzzle7 " class =" Http\HttplugBundle\ClientFactory\Guzzle7Factory " public =" false" />
92
+ <service id =" httplug.factory.guzzle6 " class =" Http\HttplugBundle\ClientFactory\Guzzle6Factory " public =" false" />
93
93
<service id =" httplug.factory.react" class =" Http\HttplugBundle\ClientFactory\ReactFactory" public =" false" >
94
94
<argument type =" service" id =" httplug.message_factory" />
95
95
</service >
Original file line number Diff line number Diff line change 4
4
5
5
namespace Http \HttplugBundle \Tests \Unit \DependencyInjection \Compiler ;
6
6
7
- use Http \Adapter \Guzzle7 \Client ;
7
+ use Http \Adapter \Guzzle6 \Client ;
8
8
use Http \Client \HttpAsyncClient ;
9
9
use Http \Client \HttpClient ;
10
10
use Http \Discovery \HttpClientDiscovery ;
Original file line number Diff line number Diff line change 11
11
'stream_factory ' => 'my_stream_factory ' ,
12
12
],
13
13
'classes ' => [
14
- 'client ' => 'Http\Adapter\Guzzle7 \Client ' ,
14
+ 'client ' => 'Http\Adapter\Guzzle6 \Client ' ,
15
15
'message_factory ' => 'Http\Message\MessageFactory\GuzzleMessageFactory ' ,
16
16
'uri_factory ' => 'Http\Message\UriFactory\GuzzleUriFactory ' ,
17
17
'stream_factory ' => 'Http\Message\StreamFactory\GuzzleStreamFactory ' ,
18
- 'psr18_client ' => 'Http\Adapter\Guzzle7 \Client ' ,
18
+ 'psr18_client ' => 'Http\Adapter\Guzzle6 \Client ' ,
19
19
'psr17_request_factory ' => 'Nyholm\Psr7\Factory\Psr17Factory ' ,
20
20
'psr17_response_factory ' => 'Nyholm\Psr7\Factory\Psr17Factory ' ,
21
21
'psr17_stream_factory ' => 'Nyholm\Psr7\Factory\Psr17Factory ' ,
25
25
],
26
26
'clients ' => [
27
27
'test ' => [
28
- 'factory ' => 'httplug.factory.guzzle7 ' ,
28
+ 'factory ' => 'httplug.factory.guzzle6 ' ,
29
29
'http_methods_client ' => true ,
30
30
'plugins ' => [
31
31
'httplug.plugin.redirect ' ,
Original file line number Diff line number Diff line change 10
10
<stream-factory >my_stream_factory</stream-factory >
11
11
</main-alias >
12
12
<classes >
13
- <client >Http\Adapter\Guzzle7 \Client</client >
13
+ <client >Http\Adapter\Guzzle6 \Client</client >
14
14
<message-factory >Http\Message\MessageFactory\GuzzleMessageFactory</message-factory >
15
15
<uri-factory >Http\Message\UriFactory\GuzzleUriFactory</uri-factory >
16
16
<stream-factory >Http\Message\StreamFactory\GuzzleStreamFactory</stream-factory >
17
- <psr18-client >Http\Adapter\Guzzle7 \Client</psr18-client >
17
+ <psr18-client >Http\Adapter\Guzzle6 \Client</psr18-client >
18
18
<psr17-request-factory >Nyholm\Psr7\Factory\Psr17Factory</psr17-request-factory >
19
19
<psr17-response-factory >Nyholm\Psr7\Factory\Psr17Factory</psr17-response-factory >
20
20
<psr17-stream-factory >Nyholm\Psr7\Factory\Psr17Factory</psr17-stream-factory >
21
21
<psr17-uri-factory >Nyholm\Psr7\Factory\Psr17Factory</psr17-uri-factory >
22
22
<psr17-uploaded-file-factory >Nyholm\Psr7\Factory\Psr17Factory</psr17-uploaded-file-factory >
23
23
<psr17-server-request-factory >Nyholm\Psr7\Factory\Psr17Factory</psr17-server-request-factory >
24
24
</classes >
25
- <client name =" test" factory =" httplug.factory.guzzle7 " http-methods-client =" true" >
25
+ <client name =" test" factory =" httplug.factory.guzzle6 " http-methods-client =" true" >
26
26
<plugin >httplug.plugin.redirect</plugin >
27
27
<plugin >
28
28
<add-host host =" http://localhost" />
Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ httplug:
6
6
uri_factory : my_uri_factory
7
7
stream_factory : my_stream_factory
8
8
classes :
9
- client : Http\Adapter\Guzzle7 \Client
9
+ client : Http\Adapter\Guzzle6 \Client
10
10
message_factory : Http\Message\MessageFactory\GuzzleMessageFactory
11
11
uri_factory : Http\Message\UriFactory\GuzzleUriFactory
12
12
stream_factory : Http\Message\StreamFactory\GuzzleStreamFactory
13
- psr18_client : Http\Adapter\Guzzle7 \Client
13
+ psr18_client : Http\Adapter\Guzzle6 \Client
14
14
psr17_request_factory : Nyholm\Psr7\Factory\Psr17Factory
15
15
psr17_response_factory : Nyholm\Psr7\Factory\Psr17Factory
16
16
psr17_stream_factory : Nyholm\Psr7\Factory\Psr17Factory
@@ -19,7 +19,7 @@ httplug:
19
19
psr17_server_request_factory : Nyholm\Psr7\Factory\Psr17Factory
20
20
clients :
21
21
test :
22
- factory : httplug.factory.guzzle7
22
+ factory : httplug.factory.guzzle6
23
23
http_methods_client : true
24
24
plugins :
25
25
- ' httplug.plugin.redirect'
Original file line number Diff line number Diff line change 7
7
async_client : auto
8
8
clients :
9
9
acme :
10
- factory : httplug.factory.guzzle7
10
+ factory : httplug.factory.guzzle6
11
11
plugins :
12
12
-
13
13
decoder :
Original file line number Diff line number Diff line change 4
4
5
5
namespace Http \HttplugBundle \Tests \Unit \ClientFactory ;
6
6
7
- use Http \Adapter \Guzzle7 \Client ;
8
- use Http \HttplugBundle \ClientFactory \Guzzle7Factory ;
7
+ use Http \Adapter \Guzzle6 \Client ;
8
+ use Http \HttplugBundle \ClientFactory \Guzzle6Factory ;
9
9
use PHPUnit \Framework \TestCase ;
10
10
11
11
/**
12
12
* @author Tobias Nyholm <[email protected] >
13
13
*/
14
- class Guzzle7FactoryTest extends TestCase
14
+ class Guzzle6FactoryTest extends TestCase
15
15
{
16
16
public function testCreateClient (): void
17
17
{
18
18
if (!class_exists (Client::class)) {
19
19
$ this ->markTestSkipped ('Guzzle6 adapter is not installed ' );
20
20
}
21
21
22
- $ factory = new Guzzle7Factory ();
22
+ $ factory = new Guzzle6Factory ();
23
23
$ client = $ factory ->createClient ();
24
24
25
25
$ this ->assertInstanceOf (Client::class, $ client );
You can’t perform that action at this time.
0 commit comments