DriverInterface.php 773 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /*
  3. * This file is a part of the DiscordPHP-Http project.
  4. *
  5. * Copyright (c) 2021-present David Cole <david.cole1340@gmail.com>
  6. *
  7. * This file is subject to the MIT license that is bundled
  8. * with this source code in the LICENSE file.
  9. */
  10. namespace Discord\Http;
  11. use Psr\Http\Message\ResponseInterface;
  12. use React\Promise\ExtendedPromiseInterface;
  13. /**
  14. * Interface for an HTTP driver.
  15. *
  16. * @author David Cole <david.cole1340@gmail.com>
  17. */
  18. interface DriverInterface
  19. {
  20. /**
  21. * Runs a request.
  22. *
  23. * Returns a promise resolved with a PSR response interface.
  24. *
  25. * @param Request $request
  26. *
  27. * @return ExtendedPromiseInterface<ResponseInterface>
  28. */
  29. public function runRequest(Request $request): ExtendedPromiseInterface;
  30. }