MessageFactoryInterface.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /*
  3. * This file is part of the php-phantomjs.
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. */
  8. namespace JonnyW\PhantomJs\Message;
  9. /**
  10. * PHP PhantomJs
  11. *
  12. * @author Jon Wenmoth <contact@jonnyw.me>
  13. */
  14. interface MessageFactoryInterface
  15. {
  16. /**
  17. * Get singleton instance.
  18. *
  19. * @access public
  20. * @return \JonnyW\PhantomJs\Message\MessageFactoryInterface
  21. */
  22. public static function getInstance();
  23. /**
  24. * Create request instance.
  25. *
  26. * @access public
  27. * @param string $url (default: null)
  28. * @param string $method (default: RequestInterface::METHOD_GET)
  29. * @param int $timeout (default: 5000)
  30. * @return \JonnyW\PhantomJs\Message\RequestInterface
  31. */
  32. public function createRequest($url = null, $method = RequestInterface::METHOD_GET, $timeout = 5000);
  33. /**
  34. * Create capture request instance.
  35. *
  36. * @access public
  37. * @param string $url (default: null)
  38. * @param string $method (default: RequestInterface::METHOD_GET)
  39. * @param int $timeout (default: 5000)
  40. * @return \JonnyW\PhantomJs\Message\RequestInterface
  41. */
  42. public function createCaptureRequest($url = null, $method = RequestInterface::METHOD_GET, $timeout = 5000);
  43. /**
  44. * Create response instance.
  45. *
  46. * @access public
  47. * @return \JonnyW\PhantomJs\Message\ResponseInterface
  48. */
  49. public function createResponse();
  50. }