File tree Expand file tree Collapse file tree 4 files changed +5
-17
lines changed Expand file tree Collapse file tree 4 files changed +5
-17
lines changed Original file line number Diff line number Diff line change 45
45
"php-http/guzzle6-adapter" : " <1.1" ,
46
46
"php-http/curl-client" : " <2.0" ,
47
47
"php-http/socket-client" : " <2.0" ,
48
- "kriswallsmith/buzz" : " <0.17"
48
+ "kriswallsmith/buzz" : " <0.17" ,
49
+ "php-http/react-adapter" : " <3.0"
49
50
},
50
51
"require-dev" : {
51
52
"guzzlehttp/psr7" : " ^1.7 || ^2.0" ,
Original file line number Diff line number Diff line change 5
5
namespace Http \HttplugBundle \ClientFactory ;
6
6
7
7
use Http \Adapter \React \Client ;
8
- use Http \Message \MessageFactory ;
9
8
10
9
/**
11
10
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
12
11
*/
13
12
class ReactFactory implements ClientFactory
14
13
{
15
- /**
16
- * @var MessageFactory
17
- */
18
- private $ messageFactory ;
19
-
20
- public function __construct (MessageFactory $ messageFactory )
21
- {
22
- $ this ->messageFactory = $ messageFactory ;
23
- }
24
-
25
14
/**
26
15
* {@inheritdoc}
27
16
*/
@@ -31,6 +20,6 @@ public function createClient(array $config = [])
31
20
throw new \LogicException ('To use the React adapter you need to install the "php-http/react-adapter" package. ' );
32
21
}
33
22
34
- return new Client ($ this -> messageFactory );
23
+ return new Client ();
35
24
}
36
25
}
Original file line number Diff line number Diff line change 91
91
</service >
92
92
<service id =" httplug.factory.guzzle6" class =" Http\HttplugBundle\ClientFactory\Guzzle6Factory" public =" false" />
93
93
<service id =" httplug.factory.guzzle7" class =" Http\HttplugBundle\ClientFactory\Guzzle7Factory" public =" false" />
94
- <service id =" httplug.factory.react" class =" Http\HttplugBundle\ClientFactory\ReactFactory" public =" false" >
95
- <argument type =" service" id =" httplug.message_factory" />
96
- </service >
94
+ <service id =" httplug.factory.react" class =" Http\HttplugBundle\ClientFactory\ReactFactory" public =" false" />
97
95
<service id =" httplug.factory.socket" class =" Http\HttplugBundle\ClientFactory\SocketFactory" public =" false" >
98
96
<argument type =" service" id =" httplug.message_factory" />
99
97
</service >
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public function testCreateClient(): void
20
20
$ this ->markTestSkipped ('React adapter is not installed ' );
21
21
}
22
22
23
- $ factory = new ReactFactory ($ this -> getMockBuilder (MessageFactory::class)-> getMock () );
23
+ $ factory = new ReactFactory ();
24
24
$ client = $ factory ->createClient ();
25
25
26
26
$ this ->assertInstanceOf (Client::class, $ client );
You can’t perform that action at this time.
0 commit comments