PluginProbe ʕ •ᴥ•ʔ
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 4.5.0
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v4.5.0
4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.11.0 1.11.1 1.11.2 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.9.0 1.9.1 1.9.2 1.9.3 1.9.4 1.9.5 2.0.0 2.0.1 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.10.0 2.10.1 2.11.0 2.11.1 2.11.2 2.11.3 2.11.4 2.12.0 2.13.0 2.14.0 2.14.1 2.15.0 2.15.1 2.16.0 2.16.1 2.16.2 2.16.3 2.17.0 2.17.1 2.17.2 2.18.0 2.19.0 2.19.2 2.19.3 2.19.4 2.2.0 2.2.1 2.20.0 2.20.1 2.20.2 2.20.3 2.20.4 2.20.5 2.20.6 2.21.0 2.22.0 2.22.1 2.23.0 2.24.0 2.25.0 2.25.1 2.25.2 2.26.0 2.27.0 2.27.1 2.28.0 2.29.0 2.29.1 2.29.2 2.29.3 2.29.4 2.3.0 2.3.1 2.30.0 2.31.0 2.31.1 2.31.2 2.31.3 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.40.0 2.40.1 2.5.0 2.5.1 2.5.2 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.9.0 3.0.0 3.0.0-RC1 3.0.0-RC2 3.0.0-beta1 3.0.0-beta2 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.10.0 3.10.1 3.11.0 3.12.0 3.13.0 3.13.1 3.13.2 3.13.3 3.13.4 3.14.0 3.15.0 3.15.1 3.15.2 3.15.3 3.15.4 3.15.5 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.16.6 3.16.7 3.16.8 3.17.0 3.17.1 3.17.2 3.17.3 3.17.4 3.17.5 3.17.6 3.18.0 3.19.0 3.19.1 3.19.2 3.2.0 3.2.1 3.2.2 3.20.0 3.20.1 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 4.0.0 4.0.1 4.0.2 4.0.3 trunk 4.1.0 0.2.19.1 4.1.1 1.0.0 4.2.0 1.0.1 1.0.2
surecart / vendor / psr / http-message / src / MessageInterface.php
surecart / vendor / psr / http-message / src Last commit date
MessageInterface.php 2 years ago RequestInterface.php 2 years ago ResponseInterface.php 2 years ago ServerRequestInterface.php 2 years ago StreamInterface.php 2 years ago UploadedFileInterface.php 2 years ago UriInterface.php 2 years ago
MessageInterface.php
190 lines
1 <?php
2
3 declare(strict_types=1);
4
5 namespace SureCartVendors\Psr\Http\Message;
6
7 /**
8 * HTTP messages consist of requests from a client to a server and responses
9 * from a server to a client. This interface defines the methods common to
10 * each.
11 *
12 * Messages are considered immutable; all methods that might change state MUST
13 * be implemented such that they retain the internal state of the current
14 * message and return an instance that contains the changed state.
15 *
16 * @link http://www.ietf.org/rfc/rfc7230.txt
17 * @link http://www.ietf.org/rfc/rfc7231.txt
18 */
19 interface MessageInterface
20 {
21 /**
22 * Retrieves the HTTP protocol version as a string.
23 *
24 * The string MUST contain only the HTTP version number (e.g., "1.1", "1.0").
25 *
26 * @return string HTTP protocol version.
27 */
28 public function getProtocolVersion();
29
30 /**
31 * Return an instance with the specified HTTP protocol version.
32 *
33 * The version string MUST contain only the HTTP version number (e.g.,
34 * "1.1", "1.0").
35 *
36 * This method MUST be implemented in such a way as to retain the
37 * immutability of the message, and MUST return an instance that has the
38 * new protocol version.
39 *
40 * @param string $version HTTP protocol version
41 * @return static
42 */
43 public function withProtocolVersion(string $version);
44
45 /**
46 * Retrieves all message header values.
47 *
48 * The keys represent the header name as it will be sent over the wire, and
49 * each value is an array of strings associated with the header.
50 *
51 * // Represent the headers as a string
52 * foreach ($message->getHeaders() as $name => $values) {
53 * echo $name . ": " . implode(", ", $values);
54 * }
55 *
56 * // Emit headers iteratively:
57 * foreach ($message->getHeaders() as $name => $values) {
58 * foreach ($values as $value) {
59 * header(sprintf('%s: %s', $name, $value), false);
60 * }
61 * }
62 *
63 * While header names are not case-sensitive, getHeaders() will preserve the
64 * exact case in which headers were originally specified.
65 *
66 * @return string[][] Returns an associative array of the message's headers. Each
67 * key MUST be a header name, and each value MUST be an array of strings
68 * for that header.
69 */
70 public function getHeaders();
71
72 /**
73 * Checks if a header exists by the given case-insensitive name.
74 *
75 * @param string $name Case-insensitive header field name.
76 * @return bool Returns true if any header names match the given header
77 * name using a case-insensitive string comparison. Returns false if
78 * no matching header name is found in the message.
79 */
80 public function hasHeader(string $name);
81
82 /**
83 * Retrieves a message header value by the given case-insensitive name.
84 *
85 * This method returns an array of all the header values of the given
86 * case-insensitive header name.
87 *
88 * If the header does not appear in the message, this method MUST return an
89 * empty array.
90 *
91 * @param string $name Case-insensitive header field name.
92 * @return string[] An array of string values as provided for the given
93 * header. If the header does not appear in the message, this method MUST
94 * return an empty array.
95 */
96 public function getHeader(string $name);
97
98 /**
99 * Retrieves a comma-separated string of the values for a single header.
100 *
101 * This method returns all of the header values of the given
102 * case-insensitive header name as a string concatenated together using
103 * a comma.
104 *
105 * NOTE: Not all header values may be appropriately represented using
106 * comma concatenation. For such headers, use getHeader() instead
107 * and supply your own delimiter when concatenating.
108 *
109 * If the header does not appear in the message, this method MUST return
110 * an empty string.
111 *
112 * @param string $name Case-insensitive header field name.
113 * @return string A string of values as provided for the given header
114 * concatenated together using a comma. If the header does not appear in
115 * the message, this method MUST return an empty string.
116 */
117 public function getHeaderLine(string $name);
118
119 /**
120 * Return an instance with the provided value replacing the specified header.
121 *
122 * While header names are case-insensitive, the casing of the header will
123 * be preserved by this function, and returned from getHeaders().
124 *
125 * This method MUST be implemented in such a way as to retain the
126 * immutability of the message, and MUST return an instance that has the
127 * new and/or updated header and value.
128 *
129 * @param string $name Case-insensitive header field name.
130 * @param string|string[] $value Header value(s).
131 * @return static
132 * @throws \InvalidArgumentException for invalid header names or values.
133 */
134 public function withHeader(string $name, $value);
135
136 /**
137 * Return an instance with the specified header appended with the given value.
138 *
139 * Existing values for the specified header will be maintained. The new
140 * value(s) will be appended to the existing list. If the header did not
141 * exist previously, it will be added.
142 *
143 * This method MUST be implemented in such a way as to retain the
144 * immutability of the message, and MUST return an instance that has the
145 * new header and/or value.
146 *
147 * @param string $name Case-insensitive header field name to add.
148 * @param string|string[] $value Header value(s).
149 * @return static
150 * @throws \InvalidArgumentException for invalid header names or values.
151 */
152 public function withAddedHeader(string $name, $value);
153
154 /**
155 * Return an instance without the specified header.
156 *
157 * Header resolution MUST be done without case-sensitivity.
158 *
159 * This method MUST be implemented in such a way as to retain the
160 * immutability of the message, and MUST return an instance that removes
161 * the named header.
162 *
163 * @param string $name Case-insensitive header field name to remove.
164 * @return static
165 */
166 public function withoutHeader(string $name);
167
168 /**
169 * Gets the body of the message.
170 *
171 * @return StreamInterface Returns the body as a stream.
172 */
173 public function getBody();
174
175 /**
176 * Return an instance with the specified message body.
177 *
178 * The body MUST be a StreamInterface object.
179 *
180 * This method MUST be implemented in such a way as to retain the
181 * immutability of the message, and MUST return a new instance that has the
182 * new body stream.
183 *
184 * @param StreamInterface $body Body.
185 * @return static
186 * @throws \InvalidArgumentException When the body is not valid.
187 */
188 public function withBody(StreamInterface $body);
189 }
190