/library/Google/vendor/google/auth/src/HttpHandler/Guzzle6HttpHandler.php

https://gitlab.com/vangtrangbac123/zinkaiuit.tk · PHP · 36 lines · 17 code · 5 blank · 14 comment · 0 complexity · 326b39b7229d474548c23117ad92a458 MD5 · raw file

  1. <?php
  2. namespace Google\Auth\HttpHandler;
  3. use GuzzleHttp\ClientInterface;
  4. use Psr\Http\Message\RequestInterface;
  5. use Psr\Http\Message\ResponseInterface;
  6. class Guzzle6HttpHandler
  7. {
  8. /**
  9. * @var ClientInterface
  10. */
  11. private $client;
  12. /**
  13. * @param ClientInterface $client
  14. */
  15. public function __construct(ClientInterface $client)
  16. {
  17. $this->client = $client;
  18. }
  19. /**
  20. * Accepts a PSR-7 request and an array of options and returns a PSR-7 response.
  21. *
  22. * @param RequestInterface $request
  23. * @param array $options
  24. *
  25. * @return ResponseInterface
  26. */
  27. public function __invoke(RequestInterface $request, array $options = [])
  28. {
  29. return $this->client->send($request, $options);
  30. }
  31. }