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
Declaration of Smalot\Cups\Transport\Client::sendRequest(Psr\Http\Message\RequestInterface $request) must be compatible with Psr\Http\Client\ClientInterface::sendRequest(Psr\Http\Message\RequestInterface $request): Psr\Http\Message\ResponseInterface
#29
Open
cjprinse opened this issue
Jul 12, 2021
· 5 comments
"Declaration of Smalot\Cups\Transport\Client::sendRequest(Psr\Http\Message\RequestInterface $request) must be compatible with Psr\Http\Client\ClientInterface::sendRequest(Psr\Http\Message\RequestInterface $request): Psr\Http\Message\ResponseInterface"
This is because of version constraints of dependencies has been removed
in Transport/Client.php
add: use Psr\Http\Client\ClientInterface;
add: use Psr\Http\Message\ResponseInterface;
del: class Client implements HttpClient
add: class Client implements ClientInterface
del: public function sendRequest(RequestInterface $request)
add: public function sendRequest(RequestInterface $request): ResponseInterface
in Manager/ManagerAbstract.php
del: use Http\Client\HttpClient;
add: use Psr\Http\Client\ClientInterface;
del: * @var \Http\Client\HttpClient
add: * @var \use Psr\Http\Client\ClientInterface;
del: public function __construct(Builder $builder, HttpClient $client, ResponseParser $responseParser)
add: public function __construct(Builder $builder, ClientInterface $client, ResponseParser $responseParser)
del: * @param \Http\Client\HttpClient $client
add: * @param \Psr\Http\Client\ClientInterface $client
That should do the trick. Also I had some hostname issues, so in Client.php I made this: $host = 'https://<domain>:631;
After update from 0.4 to 0.5 I get this error:
"Declaration of Smalot\Cups\Transport\Client::sendRequest(Psr\Http\Message\RequestInterface $request) must be compatible with Psr\Http\Client\ClientInterface::sendRequest(Psr\Http\Message\RequestInterface $request): Psr\Http\Message\ResponseInterface"
This is because of version constraints of dependencies has been removed
php-http/httplug ^2.0 introduces a new interface for ClientInterface
The text was updated successfully, but these errors were encountered: