Open
Description
In order to you your library with php-http/discovery
, HandlerStack parameter in WpClient
needs to be nullable because ClassDiscovery
calls the constructor without parameters.
Set HandlerStack like this.
class WpClient {
/**
* Constructor.
*
* @param HandlerInterface $handler The handler to use for dispatching requests and receiving responses.
* @param UriInterface|null $baseUri Optional base URI for all relative requests sent using this client.
*
* @throws InvalidArgumentException If the "base_uri" option is present and is not a valid URI.
*/
public function __construct( ?HandlerInterface $handler = null, ?UriInterface $baseUri = null ) {
$this->handler = $handler ?? HandlerStack::CreateDefault();
$this->baseUri = $baseUri;
}
}
This make your http client compatible with the discovery library.
Metadata
Metadata
Assignees
Labels
No labels