VersionBridgeClient.php 594 B

123456789101112131415161718192021222324
  1. <?php
  2. declare(strict_types=1);
  3. namespace Http\Client\Common;
  4. use Psr\Http\Message\RequestInterface;
  5. use Psr\Http\Message\ResponseInterface;
  6. /**
  7. * A client that helps you migrate from php-http/httplug 1.x to 2.x. This
  8. * will also help you to support PHP5 at the same time you support 2.x.
  9. *
  10. * @author Tobias Nyholm <tobias.nyholm@gmail.com>
  11. */
  12. trait VersionBridgeClient
  13. {
  14. abstract protected function doSendRequest(RequestInterface $request);
  15. public function sendRequest(RequestInterface $request): ResponseInterface
  16. {
  17. return $this->doSendRequest($request);
  18. }
  19. }