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 1212 "php" : " >=5.4" ,
1313 "symfony/options-resolver" : " ^2.6|^3.0" ,
1414 "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"
1617 },
1718 "require-dev" : {
1819 "phpunit/phpunit" : " ^4.8" ,
1920 "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"
2725 },
2826 "provide" : {
2927 "php-http/client-implementation" : " 1.0"
Original file line number Diff line number Diff line change 4444 },
4545 "php-http/discovery" : {
4646 "install-path" : " vendor/php-http/discovery" ,
47- "installer" : " composer" ,
48- "env" : " dev"
47+ "installer" : " composer"
4948 },
5049 "php-http/httplug" : {
5150 "install-path" : " vendor/php-http/httplug" ,
Original file line number Diff line number Diff line change 55use Http \Client \Exception \NetworkException ;
66use Http \Client \HttpClient ;
77use Http \Discovery \MessageFactoryDiscovery ;
8- use Http \Message \MessageFactory ;
98use Http \Message \ResponseFactory ;
109use Psr \Http \Message \RequestInterface ;
1110use Symfony \Component \OptionsResolver \Options ;
@@ -47,15 +46,9 @@ class Client implements HttpClient
4746 * @var int $write_buffer_size Buffer when writing the request body, defaults to 8192
4847 * @var int $ssl_method Crypto method for ssl/tls, see PHP doc, defaults to STREAM_CRYPTO_METHOD_TLS_CLIENT
4948 * }
50- *
51- * @throws \LogicException When MessageFactory is not provided and cannot be discovered
5249 */
5350 public function __construct (ResponseFactory $ responseFactory = null , array $ config = [])
5451 {
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-
5952 if (null === $ responseFactory ) {
6053 $ responseFactory = MessageFactoryDiscovery::find ();
6154 }
You can’t perform that action at this time.
0 commit comments