File tree Expand file tree Collapse file tree 3 files changed +7
-17
lines changed Expand file tree Collapse file tree 3 files changed +7
-17
lines changed Original file line number Diff line number Diff line change 12
12
"php" : " >=5.4" ,
13
13
"symfony/options-resolver" : " ^2.6|^3.0" ,
14
14
"php-http/httplug" : " ^1.0" ,
15
- "php-http/message-factory" : " ^1.0.2"
15
+ "php-http/message-factory" : " ^1.0.2" ,
16
+ "php-http/discovery" : " ^0.8"
16
17
},
17
18
"require-dev" : {
18
19
"phpunit/phpunit" : " ^4.8" ,
19
20
"guzzlehttp/psr7" : " ^1.2" ,
20
- "php-http/discovery" : " ^0.8@dev" ,
21
- "php-http/adapter-integration-tests" : " dev-master" ,
22
- "php-http/message" : " ^0.2@dev" ,
23
- "php-http/client-common" : " 0.2.0"
24
- },
25
- "suggest" : {
26
- "php-http/discovery" : " Used for message factory discovery"
21
+ "php-http/adapter-integration-tests" : " ~0.3.1" ,
22
+ "php-http/message" : " ^1.0" ,
23
+ "php-http/client-common" : " ^1.0" ,
24
+ "puli/composer-plugin" : " 1.0.0-beta9"
27
25
},
28
26
"provide" : {
29
27
"php-http/client-implementation" : " 1.0"
Original file line number Diff line number Diff line change 44
44
},
45
45
"php-http/discovery" : {
46
46
"install-path" : " vendor/php-http/discovery" ,
47
- "installer" : " composer" ,
48
- "env" : " dev"
47
+ "installer" : " composer"
49
48
},
50
49
"php-http/httplug" : {
51
50
"install-path" : " vendor/php-http/httplug" ,
Original file line number Diff line number Diff line change 5
5
use Http \Client \Exception \NetworkException ;
6
6
use Http \Client \HttpClient ;
7
7
use Http \Discovery \MessageFactoryDiscovery ;
8
- use Http \Message \MessageFactory ;
9
8
use Http \Message \ResponseFactory ;
10
9
use Psr \Http \Message \RequestInterface ;
11
10
use Symfony \Component \OptionsResolver \Options ;
@@ -47,15 +46,9 @@ class Client implements HttpClient
47
46
* @var int $write_buffer_size Buffer when writing the request body, defaults to 8192
48
47
* @var int $ssl_method Crypto method for ssl/tls, see PHP doc, defaults to STREAM_CRYPTO_METHOD_TLS_CLIENT
49
48
* }
50
- *
51
- * @throws \LogicException When MessageFactory is not provided and cannot be discovered
52
49
*/
53
50
public function __construct (ResponseFactory $ responseFactory = null , array $ config = [])
54
51
{
55
- if (null === $ responseFactory && !class_exists ('\Http\Discovery\MessageFactoryDiscovery ' )) {
56
- throw new \LogicException ('No response factory provided and no discovery service is present to guess it, maybe you need to install php-http/discovery package? ' );
57
- }
58
-
59
52
if (null === $ responseFactory ) {
60
53
$ responseFactory = MessageFactoryDiscovery::find ();
61
54
}
You can’t perform that action at this time.
0 commit comments