Skip to content

Commit 23e7913

Browse files
committed
allow to set any type of client on the MockFactory and make the factory final
1 parent 8b7cb00 commit 23e7913

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee
1414

1515
- Removed `twig/twig` dependency
1616

17+
### Fixed
18+
19+
- MockFactory now accepts any client, e.g. a mock client decorated with the
20+
plugin client for the development panel, so that configuring a mock client
21+
actually works. The MockFactory is now `final`.
22+
1723
## 1.14.0
1824

1925
### Added

ClientFactory/MockFactory.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,25 @@
22

33
namespace Http\HttplugBundle\ClientFactory;
44

5+
use Http\Client\HttpClient;
56
use Http\Mock\Client;
67

78
/**
89
* @author Gary PEGEOT <garypegeot@gmail.com>
910
*/
10-
class MockFactory implements ClientFactory
11+
final class MockFactory implements ClientFactory
1112
{
1213
/**
13-
* @var Client
14+
* @var HttpClient
1415
*/
1516
private $client;
1617

1718
/**
18-
* @param Client $client
19+
* Set the client instance that this factory should return.
20+
*
21+
* Note that this can be any client, not only a mock client.
1922
*/
20-
public function setClient(Client $client)
23+
public function setClient(HttpClient $client)
2124
{
2225
$this->client = $client;
2326
}

0 commit comments

Comments
 (0)