InputInterface.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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\IO;
  9. use Psr\Http\Message\MessageInterface;
  10. /**
  11. * PHP PhantomJs.
  12. *
  13. * @author Jon Wenmoth <contact@jonnyw.me>
  14. */
  15. interface InputInterface extends MessageInterface
  16. {
  17. /**
  18. * Create new input with
  19. * added custom setting.
  20. *
  21. * @param string $name
  22. * @param mixed $value
  23. *
  24. * @return \JonnyW\PhantomJs\IO\InputInterface
  25. */
  26. public function withCustom($name, $value);
  27. /**
  28. * Create new input with
  29. * custom setting removed.
  30. *
  31. * @param string $name
  32. *
  33. * @return \JonnyW\PhantomJs\IO\InputInterface
  34. */
  35. public function withoutCustom($name);
  36. /**
  37. * Get custom setting.
  38. *
  39. * @param string $name
  40. *
  41. * @return mixed
  42. */
  43. public function getCustom($name);
  44. /**
  45. * Has cookie.
  46. *
  47. * @param string $cookie
  48. *
  49. * @return bool
  50. */
  51. public function hasCookie($cookie);
  52. /**
  53. * Get single added cookie.
  54. *
  55. * @param string $cookie
  56. *
  57. * @return \JonnyW\PhantomJs\Page\Cookie|null
  58. */
  59. public function getCookie($cookie);
  60. /**
  61. * Get all added cookies.
  62. *
  63. * @return array
  64. */
  65. public function getCookies();
  66. /**
  67. * Create new input with
  68. * added cookie.
  69. *
  70. * @param \JonnyW\PhantomJs\Page\Cookie $cookie
  71. *
  72. * @return \JonnyW\PhantomJs\IO\InputInterface
  73. */
  74. public function withCookie(Cookie $cookie);
  75. /**
  76. * Create new input with cookie
  77. * removed and flagged for delete.
  78. *
  79. * @param string $cookie
  80. *
  81. * @return \JonnyW\PhantomJs\IO\InputInterface
  82. */
  83. public function withoutCookie($cookie);
  84. /**
  85. * Has setting.
  86. *
  87. * @param string $setting
  88. *
  89. * @return bool
  90. */
  91. public function hasSetting($setting);
  92. /**
  93. * Get single setting.
  94. *
  95. * @param string $setting
  96. *
  97. * @return mixed
  98. */
  99. public function getSetting($setting);
  100. /**
  101. * Get all settings.
  102. *
  103. * @return array
  104. */
  105. public function getSettings();
  106. /**
  107. * Create new input with
  108. * added setting.
  109. *
  110. * @param string $setting
  111. * @param mixed $value
  112. *
  113. * @return \JonnyW\PhantomJs\IO\InputInterface
  114. */
  115. public function withSetting($setting, $value);
  116. /**
  117. * Create new input with setting
  118. * removed.
  119. *
  120. * @param string $setting
  121. *
  122. * @return \JonnyW\PhantomJs\IO\InputInterface
  123. */
  124. public function withoutSetting($setting);
  125. /**
  126. * Get input type.
  127. *
  128. * @return string
  129. */
  130. public function getType();
  131. }