Since the PSR-18 vote has basically passed, this makes the Http class implement Psr\Http\Client\ClientInterface and our custom exceptions implement Psr\Http\Client\ClientExceptionInterface. The basic change needed was making the sendRequest method typehint the return type, and since this is only added on the 2.0 branch there's no B/C issue with that.
Note that for now this does NOT make the full package PSR-18 compliant; most of our exceptions are still core PHP exceptions and we need to add more exception subclasses for the other error types implementing Psr\Http\Client\ClientExceptionInterface for full minimal compliance (we really should be implementing Psr\Http\Client\NetworkExceptionInterface and Psr\Http\Client\RequestExceptionInterface in our exceptions but those require a Psr\Http\Message\RequestInterface object and our transports are not prepared to receive a PSR-7 Request object right now).
The other "significant" change in this PR is just changing the exception about an invalid param for the URI to use the FQCN instead of the shortened UriInterface.
Summary of Changes
Since the PSR-18 vote has basically passed, this makes the
Http
class implementPsr\Http\Client\ClientInterface
and our custom exceptions implementPsr\Http\Client\ClientExceptionInterface
. The basic change needed was making thesendRequest
method typehint the return type, and since this is only added on the 2.0 branch there's no B/C issue with that.Note that for now this does NOT make the full package PSR-18 compliant; most of our exceptions are still core PHP exceptions and we need to add more exception subclasses for the other error types implementing
Psr\Http\Client\ClientExceptionInterface
for full minimal compliance (we really should be implementingPsr\Http\Client\NetworkExceptionInterface
andPsr\Http\Client\RequestExceptionInterface
in our exceptions but those require aPsr\Http\Message\RequestInterface
object and our transports are not prepared to receive a PSR-7 Request object right now).The other "significant" change in this PR is just changing the exception about an invalid param for the URI to use the FQCN instead of the shortened
UriInterface
.