File tree Expand file tree Collapse file tree 4 files changed +5
-18
lines changed Expand file tree Collapse file tree 4 files changed +5
-18
lines changed Original file line number Diff line number Diff line change 4545 "php-http/guzzle6-adapter" : " <1.1" ,
4646 "php-http/curl-client" : " <2.0" ,
4747 "php-http/socket-client" : " <2.0" ,
48- "kriswallsmith/buzz" : " <0.17"
48+ "kriswallsmith/buzz" : " <0.17" ,
49+ "php-http/react-adapter" : " <3.0"
4950 },
5051 "require-dev" : {
5152 "guzzlehttp/psr7" : " ^1.7 || ^2.0" ,
Original file line number Diff line number Diff line change 55namespace Http \HttplugBundle \ClientFactory ;
66
77use Http \Adapter \React \Client ;
8- use Http \Message \MessageFactory ;
98
109/**
1110 * @author Tobias Nyholm <[email protected] > 1211 */
1312class ReactFactory implements ClientFactory
1413{
15- /**
16- * @var MessageFactory
17- */
18- private $ messageFactory ;
19-
20- public function __construct (MessageFactory $ messageFactory )
21- {
22- $ this ->messageFactory = $ messageFactory ;
23- }
24-
2514 /**
2615 * {@inheritdoc}
2716 */
@@ -31,6 +20,6 @@ public function createClient(array $config = [])
3120 throw new \LogicException ('To use the React adapter you need to install the "php-http/react-adapter" package. ' );
3221 }
3322
34- return new Client ($ this -> messageFactory );
23+ return new Client ();
3524 }
3625}
Original file line number Diff line number Diff line change 9191 </service >
9292 <service id =" httplug.factory.guzzle6" class =" Http\HttplugBundle\ClientFactory\Guzzle6Factory" public =" false" />
9393 <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" />
9795 <service id =" httplug.factory.socket" class =" Http\HttplugBundle\ClientFactory\SocketFactory" public =" false" >
9896 <argument type =" service" id =" httplug.message_factory" />
9997 </service >
Original file line number Diff line number Diff line change 66
77use Http \Adapter \React \Client ;
88use Http \HttplugBundle \ClientFactory \ReactFactory ;
9- use Http \Message \MessageFactory ;
109use PHPUnit \Framework \TestCase ;
1110
1211/**
@@ -20,7 +19,7 @@ public function testCreateClient(): void
2019 $ this ->markTestSkipped ('React adapter is not installed ' );
2120 }
2221
23- $ factory = new ReactFactory ($ this -> getMockBuilder (MessageFactory::class)-> getMock () );
22+ $ factory = new ReactFactory ();
2423 $ client = $ factory ->createClient ();
2524
2625 $ this ->assertInstanceOf (Client::class, $ client );
You can’t perform that action at this time.
0 commit comments