Skip to content

Commit 44859f7

Browse files
committed
Socket: migrate client factory to use PSR-17
1 parent 5e4db5e commit 44859f7

File tree

3 files changed

+2
-16
lines changed

3 files changed

+2
-16
lines changed

src/ClientFactory/SocketFactory.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,12 @@
55
namespace Http\HttplugBundle\ClientFactory;
66

77
use Http\Client\Socket\Client;
8-
use Http\Message\MessageFactory;
98

109
/**
1110
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
1211
*/
1312
class SocketFactory 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
*/

src/Resources/config/services.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@
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" />
9494
<service id="httplug.factory.react" class="Http\HttplugBundle\ClientFactory\ReactFactory" public="false" />
95-
<service id="httplug.factory.socket" class="Http\HttplugBundle\ClientFactory\SocketFactory" public="false">
96-
<argument type="service" id="httplug.message_factory"/>
97-
</service>
95+
<service id="httplug.factory.socket" class="Http\HttplugBundle\ClientFactory\SocketFactory" public="false" />
9896
<service id="httplug.factory.symfony" class="Http\HttplugBundle\ClientFactory\SymfonyFactory" public="false">
9997
<argument type="service" id="httplug.psr17_response_factory"/>
10098
<argument type="service" id="httplug.psr17_stream_factory"/>

tests/Unit/ClientFactory/SocketFactoryTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use Http\Client\Socket\Client;
88
use Http\HttplugBundle\ClientFactory\SocketFactory;
9-
use Http\Message\MessageFactory;
109
use PHPUnit\Framework\TestCase;
1110

1211
/**
@@ -20,7 +19,7 @@ public function testCreateClient(): void
2019
$this->markTestSkipped('Socket client is not installed');
2120
}
2221

23-
$factory = new SocketFactory($this->getMockBuilder(MessageFactory::class)->getMock());
22+
$factory = new SocketFactory();
2423
$client = $factory->createClient();
2524

2625
$this->assertInstanceOf(Client::class, $client);

0 commit comments

Comments
 (0)