You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownew \LogicException('You cannot use "Symfony\Component\HttpClient\HttplugClient" as the "php-http/httplug" package is not installed. Try running "composer require php-http/httplug".');
33
38
}
34
39
35
-
if (!interface_exists(ClientInterface::class)) {
36
-
thrownew \LogicException('You cannot use "Symfony\Component\HttpClient\HttplugClient" as the "psr/http-client" package is not installed. Try running "composer require psr/http-client".');
37
-
}
38
-
39
40
if (!interface_exists(RequestFactory::class)) {
40
41
thrownew \LogicException('You cannot use "Symfony\Component\HttpClient\HttplugClient" as the "php-http/message-factory" package is not installed. Try running "composer require nyholm/psr7".');
41
42
}
42
43
43
44
/**
44
45
* An adapter to turn a Symfony HttpClientInterface into an Httplug client.
45
46
*
46
-
* Run "composer require psr/http-client" to install the base ClientInterface. Run
47
-
* "composer require nyholm/psr7" to install an efficient implementation of response
47
+
* Run "composer require nyholm/psr7" to install an efficient implementation of response
48
48
* and stream factories with flex-provided autowiring aliases.
if (null !== $this->responseFactory && null !== $this->streamFactory) {
65
+
return;
66
+
}
67
+
68
+
if (!class_exists(Psr17Factory::class)) {
69
+
thrownew \LogicException('You cannot use the "Symfony\Component\HttpClient\HttplugClient" as no PSR-17 factories have been provided. Try running "composer require nyholm/psr7".');
thrownew \LogicException(sprintf('You cannot use "%s()" as the "nyholm/psr7" package is not installed. Try running "composer require nyholm/psr7".', __METHOD__));
123
+
} else {
124
+
$request = newRequest($method, $uri);
125
+
}
126
+
127
+
$request = $request
82
128
->withProtocolVersion($protocolVersion)
83
129
->withBody($this->createStream($body))
84
130
;
@@ -100,27 +146,37 @@ public function createStream($body = null): StreamInterface
if ($this->responseFactoryinstanceof UriFactoryInterface) {
173
+
return$this->responseFactory->createUri($uri);
174
+
}
175
+
176
+
if (!class_exists(Uri::class)) {
177
+
thrownew \LogicException(sprintf('You cannot use "%s()" as the "nyholm/psr7" package is not installed. Try running "composer require nyholm/psr7".', __METHOD__));
0 commit comments