PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | vendor_prefixed/guzzlehttp/guzzle/src/RequestOptions.php +208 -57 27.5 → trunk View file →
@@ -4,9 +4,9 @@
4 4
5 5 /**
6 6 * This class contains a list of built-in Guzzle request options.
7 7 *
8 - * @see https://docs.guzzlephp.org/en/latest/request-options.html
8 + * @see https://github.com/guzzle/guzzle/blob/7.15/docs/request-options.md
9 9 */
10 10 final class RequestOptions
11 11 {
12 12 /**
@@ -19,42 +19,55 @@
19 19 *
20 20 * - max: (int, default=5) maximum number of allowed redirects.
21 21 * - strict: (bool, default=false) Set to true to use strict redirects
22 22 * meaning redirect POST requests with POST requests vs. doing what most
23 - * browsers do which is redirect POST requests with GET requests
23 + * browsers do which is redirect POST requests with GET requests. The
24 + * QUERY method keeps its method and body across non-strict 301 and 302
25 + * redirects, and a 303 redirect is followed with a body-less GET.
24 26 * - referer: (bool, default=false) Set to true to enable the Referer
25 27 * header.
26 - * - protocols: (array, default=['http', 'https']) Allowed redirect
27 - * protocols.
28 + * - protocols: (non-empty-array<array-key, string>, default=['http', 'https'])
29 + * Allowed redirect protocols. Redirect matching is case-sensitive; use
30 + * "http" and "https".
28 31 * - on_redirect: (callable) PHP callable that is invoked when a redirect
29 32 * is encountered. The callable is invoked with the request, the redirect
30 33 * response that was received, and the effective URI. Any return value
31 34 * from the on_redirect function is ignored.
35 + * - track_redirects: (bool, default=false) Track redirected URI and status
36 + * history in response headers.
32 37 */
33 38 public const ALLOW_REDIRECTS = 'allow_redirects';
34 39 /**
35 - * auth: (array) Pass an array of HTTP authentication parameters to use
36 - * with the request. The array must contain the username in index [0],
37 - * the password in index [1], and you can optionally provide a built-in
38 - * authentication type in index [2]. Pass null to disable authentication
39 - * for a request.
40 + * auth: (array{0: string, 1: string, 2?: string|null}|string|false|null)
41 + * Pass an array of HTTP authentication parameters to use with the request.
42 + * The array must contain the username in index [0], the password in index
43 + * [1], and you can optionally provide a built-in authentication type in
44 + * index [2]. Pass false or null to disable authentication for a request.
45 + * String values are passed through for custom handlers.
40 46 */
41 47 public const AUTH = 'auth';
42 48 /**
43 - * body: (resource|string|null|int|float|StreamInterface|callable|\Iterator)
44 - * Body to send in the request.
49 + * body: (resource|string|null|int|float|bool|\Psr\Http\Message\StreamInterface|(callable&object)|\Iterator|\Stringable)
50 + * Body to send in the request. Callable arrays are arrays, and arrays are
51 + * not valid body values in Guzzle.
45 52 */
46 53 public const BODY = 'body';
47 54 /**
48 - * cert: (string|array) Set to a string to specify the path to a file
49 - * containing a PEM formatted SSL client side certificate. If a password
50 - * is required, then set cert to an array containing the path to the PEM
51 - * file in the first array element followed by the certificate password
52 - * in the second array element.
55 + * cert: (string|array{0: string, 1?: string|null}) Set to a string to
56 + * specify the path to a client certificate file. PEM is the default
57 + * certificate format. If a password is required, set cert to an array
58 + * containing the certificate path in the first array element followed by
59 + * the certificate password in the second array element. A null password is
60 + * treated the same as omitting it. Use cert_type to specify another
61 + * supported certificate format.
53 62 */
54 63 public const CERT = 'cert';
55 64 /**
56 - * cookies: (bool|GuzzleHttp\Cookie\CookieJarInterface, default=false)
65 + * cert_type: (string) Specify the SSL client certificate file type.
66 + */
67 + public const CERT_TYPE = 'cert_type';
68 + /**
69 + * cookies: (false|GuzzleHttp\Cookie\CookieJarInterface, default=false)
57 70 * Specifies whether or not cookies are used in a request or what cookie
58 71 * jar to use or what cookies to send. This option only works if your
59 72 * handler has the `cookie` middleware. Valid values are `false` and
60 73 * an instance of {@see Cookie\CookieJarInterface}.
@@ -60,11 +73,11 @@
60 73 * an instance of {@see Cookie\CookieJarInterface}.
61 74 */
62 75 public const COOKIES = 'cookies';
63 76 /**
64 - * connect_timeout: (float, default=0) Float describing the number of
65 - * seconds to wait while trying to connect to a server. Use 0 to wait
66 - * 300 seconds (the default behavior).
77 + * connect_timeout: (int|float, default=0) Number of seconds to wait while
78 + * trying to connect to a server. Use 0 to wait 300 seconds (the default
79 + * behavior).
67 80 */
68 81 public const CONNECT_TIMEOUT = 'connect_timeout';
69 82 /**
70 83 * crypto_method: (int) A value describing the minimum TLS protocol
@@ -77,8 +90,23 @@
77 90 * required to use TLS 1.3.
78 91 */
79 92 public const CRYPTO_METHOD = 'crypto_method';
80 93 /**
94 + * crypto_method_max: (int) A value describing the maximum TLS protocol
95 + * version to use.
96 + *
97 + * This setting must be set to one of the
98 + * ``STREAM_CRYPTO_METHOD_TLS*_CLIENT`` constants. On the stream handler,
99 + * PHP 7.3 or higher is required to set a maximum TLS version, and PHP 7.4
100 + * or higher is required to use TLS 1.3. cURL 7.54.0 or higher is required
101 + * in order to specify a maximum TLS version with the cURL handler.
102 + */
103 + public const CRYPTO_METHOD_MAX = 'crypto_method_max';
104 + /**
105 + * curl: (array) Raw cURL options to apply when using a built-in cURL handler.
106 + */
107 + public const CURL = 'curl';
108 + /**
81 109 * debug: (bool|resource) Set to true or set to a PHP stream returned by
82 110 * fopen() enable debug output with the HTTP handler used to send a
83 111 * request.
84 112 */
@@ -83,15 +111,16 @@
83 111 * request.
84 112 */
85 113 public const DEBUG = 'debug';
86 114 /**
87 - * decode_content: (bool, default=true) Specify whether or not
115 + * decode_content: (bool|string, default=true) Specify whether or not
88 116 * Content-Encoding responses (gzip, deflate, etc.) are automatically
89 117 * decoded.
90 118 */
91 119 public const DECODE_CONTENT = 'decode_content';
92 120 /**
93 - * delay: (int) The amount of time to delay before sending in milliseconds.
121 + * delay: (int|float) The amount of time to delay before sending in
122 + * milliseconds.
94 123 */
95 124 public const DELAY = 'delay';
96 125 /**
97 126 * expect: (bool|integer) Controls the behavior of the
@@ -110,17 +139,18 @@
110 139 * using HTTP/1.1.
111 140 */
112 141 public const EXPECT = 'expect';
113 142 /**
114 - * form_params: (array) Associative array of form field names to values
115 - * where each value is a string or array of strings. Sets the Content-Type
116 - * header to application/x-www-form-urlencoded when no Content-Type header
117 - * is already present.
143 + * form_params: (array<array-key, string|int|float|bool|null|array>)
144 + * Associative array of form field names to scalar, null, or nested array
145 + * values. Sets the Content-Type header to application/x-www-form-urlencoded
146 + * when no Content-Type header is already present.
118 147 */
119 148 public const FORM_PARAMS = 'form_params';
120 149 /**
121 - * headers: (array) Associative array of HTTP headers. Each value MUST be
122 - * a string or array of strings.
150 + * headers: (array<array-key, string|non-empty-array<array-key, string>>|null)
151 + * Associative array of HTTP headers. Each value MUST be a string or non-empty
152 + * array of strings.
123 153 */
124 154 public const HEADERS = 'headers';
125 155 /**
126 156 * http_errors: (bool, default=true) Set to false to disable exceptions
@@ -129,12 +159,12 @@
129 159 * works if your handler has the `httpErrors` middleware.
130 160 */
131 161 public const HTTP_ERRORS = 'http_errors';
132 162 /**
133 - * idn: (bool|int, default=true) A combination of IDNA_* constants for
134 - * idn_to_ascii() PHP's function (see "options" parameter). Set to false to
135 - * disable IDN support completely, or to true to use the default
136 - * configuration (IDNA_DEFAULT constant).
163 + * idn_conversion: (bool|int|null, default=false) A combination of IDNA_*
164 + * constants for PHP's idn_to_ascii() function. Set to false or null to
165 + * disable IDN support, or to true to use the default configuration
166 + * (IDNA_DEFAULT constant).
137 167 */
138 168 public const IDN_CONVERSION = 'idn_conversion';
139 169 /**
140 170 * json: (mixed) Adds JSON data to a request. The provided value is JSON
@@ -142,18 +172,104 @@
142 172 * the request if no Content-Type header is already present.
143 173 */
144 174 public const JSON = 'json';
145 175 /**
146 - * multipart: (array) Array of associative arrays, each containing a
147 - * required "name" key mapping to the form field, name, a required
148 - * "contents" key mapping to a StreamInterface|resource|string, an
149 - * optional "headers" associative array of custom headers, and an
150 - * optional "filename" key mapping to a string to send as the filename in
151 - * the part. If no "filename" key is present, then no "filename" attribute
152 - * will be added to the part.
176 + * multipart: (array) Array of part arrays, each containing a required
177 + * "name" key mapping to the string or integer form field name, a required
178 + * "contents" key mapping to any non-array value accepted by PSR-7
179 + * Utils::streamFor() or a nested array of field values, an optional
180 + * "headers" array of string custom header values, and an optional
181 + * "filename" key mapping to a string to send as the filename in the part.
182 + * "headers" and "filename" cannot be used when "contents" is an array.
153 183 */
154 184 public const MULTIPART = 'multipart';
155 185 /**
186 + * multiplex: (string) Controls how a request sent through a built-in
187 + * cURL handler relates to shared, multiplexed connections: how an HTTP/2
188 + * request pursues one, or, with Multiplexing::NONE, whether the transfer
189 + * may share its connection at all. When the option is not set,
190 + * multiplexing is left to libcurl: nothing waits, and established
191 + * multiplex-capable connections are still shared. Use
192 + * Multiplexing::EAGER to explicitly never wait for pending connections,
193 + * Multiplexing::WAIT to wait on libcurl-eligible pending connections with
194 + * CURLOPT_PIPEWAIT, normally to the same origin,
195 + * Multiplexing::REQUIRE_EAGER to fail unless a multiplexed protocol is
196 + * guaranteed while dialing eagerly, or Multiplexing::REQUIRE_WAIT for the
197 + * same guarantee while also waiting on pending connections. The required
198 + * modes require a handler that permits actual multiplexing, not merely a
199 + * multiplexed protocol, and are rejected on a Multiplexing::NONE handler.
200 + * The stream handler ignores EAGER and WAIT, and rejects the required
201 + * family; CurlHandler has no multi handle to multiplex over. Explicit
202 + * modes reject deprecated raw cURL options they conflict with: the
203 + * required family cannot be combined with a raw CURLOPT_HTTP_VERSION,
204 + * CURLOPT_URL, or CURLOPT_FOLLOWLOCATION; no explicit mode can be
205 + * combined with a raw CURLOPT_PIPEWAIT on the CurlMultiHandler; and
206 + * Multiplexing::NONE on a CurlMultiHandler that permits multiplexing
207 + * cannot be combined with the raw CURLOPT_HTTP_VERSION, CURLOPT_HTTPAUTH
208 + * (including the "auth" request option's "digest" and "ntlm" modes,
209 + * which set it), CURLOPT_PROXYAUTH, CURLOPT_FOLLOWLOCATION,
210 + * CURLOPT_HTTPHEADER, CURLOPT_ALTSVC, CURLOPT_ALTSVC_CTRL, or
211 + * CURLOPT_PROXYTYPE cURL options. The required family also
212 + * rejects final CURLOPT_HTTPAUTH masks that permit NTLM, which libcurl
213 + * retries over HTTP/1.1. The required family validates its cleartext
214 + * proxy rule against the final cURL configuration, after raw options
215 + * such as CURLOPT_PROXY and CURLOPT_PRE_PROXY are applied; only the
216 + * exact raw CURLOPT_NOPROXY wildcard '*' disables the primary proxy and
217 + * pre-proxy there, and raw host-specific patterns are conservatively
218 + * treated as leaving them active. These rejections are
219 + * configuration-conflict checks, not remote security checks.
220 + *
221 + * Multiplexing::NONE disables multiplexing for a whole handler when
222 + * passed as the "multiplex" client configuration option, which
223 + * configures the default handler and also becomes the default request
224 + * option, or, when constructing a handler directly, as the
225 + * CurlMultiHandler "multiplex" constructor option. A handler
226 + * configured with Multiplexing::NONE rejects explicitly requested wait
227 + * modes as a configuration conflict when the transfer would actually
228 + * wait, and always rejects the required modes, because they require a
229 + * handler that permits actual multiplexing, not merely a multiplexed
230 + * protocol. As a request option value, Multiplexing::NONE guarantees the
231 + * transfer does not share its connection with any concurrent transfer.
232 + * Multiplexing::NONE does not force HTTP/1.1: on a Multiplexing::NONE
233 + * handler, HTTP/2 still negotiates and each transfer keeps its
234 + * connection to itself.
235 + *
236 + * The request option value is accepted exactly where the guarantee
237 + * holds and can be verified: on a CurlMultiHandler configured with
238 + * Multiplexing::NONE, for requests whose declared protocol version is
239 + * HTTP/1.x, on CurlHandler, and on the stream handler, which never
240 + * multiplexes. An HTTP/2 request with a Multiplexing::NONE request
241 + * option is rejected on a CurlMultiHandler that permits multiplexing.
242 + * On a CurlMultiHandler that permits multiplexing, Multiplexing::NONE
243 + * is also rejected with a custom "handle_factory", alongside a raw
244 + * CURLMOPT_PIPELINING cURL multi option, and combined with the raw
245 + * CURLOPT_HTTP_VERSION, CURLOPT_HTTPAUTH (including the "auth" request
246 + * option's "digest" and "ntlm" modes, which set it), CURLOPT_PROXYAUTH,
247 + * CURLOPT_FOLLOWLOCATION, CURLOPT_HTTPHEADER, CURLOPT_ALTSVC,
248 + * CURLOPT_ALTSVC_CTRL, or CURLOPT_PROXYTYPE cURL options. It is also
249 + * rejected when the request carries an Expect: 100-continue header (its
250 + * 417 retries select connections outside the safeguards; remove an
251 + * explicitly supplied header, or set the "expect" request option to
252 + * false to prevent it being added automatically).
253 + *
254 + * On a client whose multi handler permits multiplexing, the ordinary
255 + * non-streaming default stack - both cURL handlers available and no
256 + * connection caps forcing multi-only routing - runs synchronous
257 + * requests on the CurlHandler path, which satisfies the guarantee for
258 + * any protocol version, while asynchronous requests run on the
259 + * CurlMultiHandler, so an HTTP/2 request with Multiplexing::NONE
260 + * succeeds synchronously and is rejected asynchronously on the same
261 + * client. Keep-alive reuse between consecutive transfers is
262 + * unaffected, except on libcurl versions below 7.77.0 and from 8.11.0
263 + * through 8.12.1, where an accepted HTTP/1.x request on a multiplexing
264 + * CurlMultiHandler forces a fresh connection. Custom handlers receive
265 + * the "multiplex" option unchanged: its semantics are handler-defined,
266 + * Guzzle does not guarantee it is honored, and a client-level
267 + * Multiplexing::NONE with a custom handler flows to it as a default
268 + * request option without client-side enforcement.
269 + */
270 + public const MULTIPLEX = 'multiplex';
271 + /**
156 272 * on_headers: (callable) A callable that is invoked when the HTTP headers
157 273 * of the response have been received but the body has not yet begun to
158 274 * download.
159 275 */
@@ -168,8 +284,18 @@
168 284 * taken to send the request.
169 285 */
170 286 public const ON_STATS = 'on_stats';
171 287 /**
288 + * on_trailers: (callable) A callable that is invoked by the built-in cURL
289 + * handlers once per successful transfer, after the response body has been
290 + * received, with an associative array of the parsed HTTP trailers followed
291 + * by the response. Trailer field names are lowercased and grouped
292 + * case-insensitively; values keep their wire order. Malformed trailer
293 + * field lines are discarded before parsing. Trailer fields are reported
294 + * separately from response headers and are never merged into the response.
295 + */
296 + public const ON_TRAILERS = 'on_trailers';
297 + /**
172 298 * progress: (callable) Defines a function to invoke when transfer
173 299 * progress is made. The function accepts the following positional
174 300 * arguments: the total number of bytes expected to be downloaded, the
175 301 * number of bytes downloaded so far, the number of bytes expected to be
@@ -176,24 +302,32 @@
176 302 * uploaded, the number of bytes uploaded so far.
177 303 */
178 304 public const PROGRESS = 'progress';
179 305 /**
306 + * protocols: (non-empty-array<array-key, string>, default=['http', 'https'])
307 + * Allowed URI schemes. Built-in handlers accept only the case-sensitive
308 + * values "http" and "https".
309 + */
310 + public const PROTOCOLS = 'protocols';
311 + /**
180 312 * proxy: (string|array) Pass a string to specify an HTTP proxy, or an
181 313 * array to specify different proxies for different protocols (where the
182 - * key is the protocol and the value is a proxy string).
314 + * key is the protocol and the value is a proxy string or null). Provide a
315 + * "no" key as a comma-delimited string, array of strings, or null to
316 + * specify hosts or host-and-port pairs that should not be proxied.
183 317 */
184 318 public const PROXY = 'proxy';
185 319 /**
186 - * query: (array|string) Associative array of query string values to add
187 - * to the request. This option uses PHP's http_build_query() to create
188 - * the string representation. Pass a string value if you need more
189 - * control than what this method provides
320 + * query: (array<array-key, mixed>|string) Associative array of query string
321 + * values to add to the request. This option uses PHP's http_build_query()
322 + * to create the string representation. Pass a string value if you need
323 + * more control than what this method provides
190 324 */
191 325 public const QUERY = 'query';
192 326 /**
193 - * sink: (resource|string|StreamInterface) Where the data of the
194 - * response is written to. Defaults to a PHP temp stream. Providing a
195 - * string will write data to a file by the given name.
327 + * sink: (resource|string|\Psr\Http\Message\StreamInterface) Where the data
328 + * of the response is written to. Defaults to a PHP temp stream. Providing
329 + * a string will write data to a file by the given name.
196 330 */
197 331 public const SINK = 'sink';
198 332 /**
199 333 * synchronous: (bool) Set to true to inform HTTP handlers that you intend
@@ -202,20 +336,31 @@
202 336 * client methods.
203 337 */
204 338 public const SYNCHRONOUS = 'synchronous';
205 339 /**
206 - * ssl_key: (array|string) Specify the path to a file containing a private
207 - * SSL key in PEM format. If a password is required, then set to an array
208 - * containing the path to the SSL key in the first array element followed
209 - * by the password required for the certificate in the second element.
340 + * ssl_key: (array{0: string, 1?: string|null}|string) Specify the path to
341 + * a private SSL key file. PEM is the default private key format. If a
342 + * password is required, set ssl_key to an array containing the key path in
343 + * the first array element followed by the key password in the second
344 + * element. A null password is treated the same as omitting it. Use
345 + * ssl_key_type to specify another supported key format.
210 346 */
211 347 public const SSL_KEY = 'ssl_key';
212 348 /**
213 - * stream: Set to true to attempt to stream a response rather than
349 + * ssl_key_type: (string) Specify the SSL private key file type.
350 + */
351 + public const SSL_KEY_TYPE = 'ssl_key_type';
352 + /**
353 + * stream: (bool) Set to true to attempt to stream a response rather than
214 354 * download it all up-front.
215 355 */
216 356 public const STREAM = 'stream';
217 357 /**
358 + * stream_context: (array) PHP stream context options to merge into the
359 + * context used by the built-in stream handler.
360 + */
361 + public const STREAM_CONTEXT = 'stream_context';
362 + /**
218 363 * verify: (bool|string, default=true) Describes the SSL certificate
219 364 * verification behavior of a request. Set to true to enable SSL
220 365 * certificate verification using the system CA bundle when available
221 366 * (the default). Set to false to disable certificate verification (this
@@ -223,22 +368,28 @@
223 368 * disk to enable verification using a custom certificate.
224 369 */
225 370 public const VERIFY = 'verify';
226 371 /**
227 - * timeout: (float, default=0) Float describing the timeout of the
372 + * timeout: (int|float, default=0) Number describing the timeout of the
228 373 * request in seconds. Use 0 to wait indefinitely (the default behavior).
229 374 */
230 375 public const TIMEOUT = 'timeout';
231 376 /**
232 - * read_timeout: (float, default=default_socket_timeout ini setting) Float describing
233 - * the body read timeout, for stream requests.
377 + * read_timeout: (int|float, default=default_socket_timeout ini setting)
378 + * Number describing the body read timeout, for stream requests.
234 379 */
235 380 public const READ_TIMEOUT = 'read_timeout';
236 381 /**
237 - * version: (float) Specifies the HTTP protocol version to attempt to use.
382 + * retries: (int) Current retry count used by the retry middleware.
238 383 */
384 + public const RETRIES = 'retries';
385 + /**
386 + * version: (string|int|float) Specifies the HTTP protocol version to attempt
387 + * to use.
388 + */
239 389 public const VERSION = 'version';
240 390 /**
241 - * force_ip_resolve: (bool) Force client to use only ipv4 or ipv6 protocol
391 + * force_ip_resolve: (string) Set to "v4" to force IPv4 resolution or "v6"
392 + * for IPv6 resolution when supported by the handler.
242 393 */
243 394 public const FORCE_IP_RESOLVE = 'force_ip_resolve';
244 395 }