| @@ -4,11 +4,9 @@ | ||
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * This class contains a list of built-in Guzzle request options. |
| 7 | 7 | * |
| 8 | - * More documentation for each option can be found at http://guzzlephp.org/. | |
| 9 | - * | |
| 10 | - * @link http://docs.guzzlephp.org/en/v6/request-options.html | |
| 8 | + * @see https://docs.guzzlephp.org/en/latest/request-options.html | |
| 11 | 9 | */ |
| 12 | 10 | final class RequestOptions |
| 13 | 11 | { |
| 14 | 12 | /** |
| @@ -31,9 +29,9 @@ | ||
| 31 | 29 | * is encountered. The callable is invoked with the request, the redirect |
| 32 | 30 | * response that was received, and the effective URI. Any return value |
| 33 | 31 | * from the on_redirect function is ignored. |
| 34 | 32 | */ |
| 35 | - const ALLOW_REDIRECTS = 'allow_redirects'; | |
| 33 | + public const ALLOW_REDIRECTS = 'allow_redirects'; | |
| 36 | 34 | /** |
| 37 | 35 | * auth: (array) Pass an array of HTTP authentication parameters to use |
| 38 | 36 | * with the request. The array must contain the username in index [0], |
| 39 | 37 | * the password in index [1], and you can optionally provide a built-in |
| @@ -39,14 +37,14 @@ | ||
| 39 | 37 | * the password in index [1], and you can optionally provide a built-in |
| 40 | 38 | * authentication type in index [2]. Pass null to disable authentication |
| 41 | 39 | * for a request. |
| 42 | 40 | */ |
| 43 | - const AUTH = 'auth'; | |
| 41 | + public const AUTH = 'auth'; | |
| 44 | 42 | /** |
| 45 | 43 | * body: (resource|string|null|int|float|StreamInterface|callable|\Iterator) |
| 46 | 44 | * Body to send in the request. |
| 47 | 45 | */ |
| 48 | - const BODY = 'body'; | |
| 46 | + public const BODY = 'body'; | |
| 49 | 47 | /** |
| 50 | 48 | * cert: (string|array) Set to a string to specify the path to a file |
| 51 | 49 | * containing a PEM formatted SSL client side certificate. If a password |
| 52 | 50 | * is required, then set cert to an array containing the path to the PEM |
| @@ -52,39 +50,50 @@ | ||
| 52 | 50 | * is required, then set cert to an array containing the path to the PEM |
| 53 | 51 | * file in the first array element followed by the certificate password |
| 54 | 52 | * in the second array element. |
| 55 | 53 | */ |
| 56 | - const CERT = 'cert'; | |
| 54 | + public const CERT = 'cert'; | |
| 57 | 55 | /** |
| 58 | 56 | * cookies: (bool|GuzzleHttp\Cookie\CookieJarInterface, default=false) |
| 59 | 57 | * Specifies whether or not cookies are used in a request or what cookie |
| 60 | 58 | * jar to use or what cookies to send. This option only works if your |
| 61 | 59 | * handler has the `cookie` middleware. Valid values are `false` and |
| 62 | - * an instance of {@see GuzzleHttp\Cookie\CookieJarInterface}. | |
| 60 | + * an instance of {@see Cookie\CookieJarInterface}. | |
| 63 | 61 | */ |
| 64 | - const COOKIES = 'cookies'; | |
| 62 | + public const COOKIES = 'cookies'; | |
| 65 | 63 | /** |
| 66 | 64 | * connect_timeout: (float, default=0) Float describing the number of |
| 67 | 65 | * seconds to wait while trying to connect to a server. Use 0 to wait |
| 68 | - * indefinitely (the default behavior). | |
| 66 | + * 300 seconds (the default behavior). | |
| 69 | 67 | */ |
| 70 | - const CONNECT_TIMEOUT = 'connect_timeout'; | |
| 68 | + public const CONNECT_TIMEOUT = 'connect_timeout'; | |
| 71 | 69 | /** |
| 70 | + * crypto_method: (int) A value describing the minimum TLS protocol | |
| 71 | + * version to use. | |
| 72 | + * | |
| 73 | + * This setting must be set to one of the | |
| 74 | + * ``STREAM_CRYPTO_METHOD_TLS*_CLIENT`` constants. PHP 7.4 or higher is | |
| 75 | + * required in order to use TLS 1.3, and cURL 7.34.0 or higher is required | |
| 76 | + * in order to specify a crypto method, with cURL 7.52.0 or higher being | |
| 77 | + * required to use TLS 1.3. | |
| 78 | + */ | |
| 79 | + public const CRYPTO_METHOD = 'crypto_method'; | |
| 80 | + /** | |
| 72 | 81 | * debug: (bool|resource) Set to true or set to a PHP stream returned by |
| 73 | 82 | * fopen() enable debug output with the HTTP handler used to send a |
| 74 | 83 | * request. |
| 75 | 84 | */ |
| 76 | - const DEBUG = 'debug'; | |
| 85 | + public const DEBUG = 'debug'; | |
| 77 | 86 | /** |
| 78 | 87 | * decode_content: (bool, default=true) Specify whether or not |
| 79 | 88 | * Content-Encoding responses (gzip, deflate, etc.) are automatically |
| 80 | 89 | * decoded. |
| 81 | 90 | */ |
| 82 | - const DECODE_CONTENT = 'decode_content'; | |
| 91 | + public const DECODE_CONTENT = 'decode_content'; | |
| 83 | 92 | /** |
| 84 | 93 | * delay: (int) The amount of time to delay before sending in milliseconds. |
| 85 | 94 | */ |
| 86 | - const DELAY = 'delay'; | |
| 95 | + public const DELAY = 'delay'; | |
| 87 | 96 | /** |
| 88 | 97 | * expect: (bool|integer) Controls the behavior of the |
| 89 | 98 | * "Expect: 100-Continue" header. |
| 90 | 99 | * |
| @@ -99,9 +108,9 @@ | ||
| 99 | 108 | * By default, Guzzle will add the "Expect: 100-Continue" header when the |
| 100 | 109 | * size of the body of a request is greater than 1 MB and a request is |
| 101 | 110 | * using HTTP/1.1. |
| 102 | 111 | */ |
| 103 | - const EXPECT = 'expect'; | |
| 112 | + public const EXPECT = 'expect'; | |
| 104 | 113 | /** |
| 105 | 114 | * form_params: (array) Associative array of form field names to values |
| 106 | 115 | * where each value is a string or array of strings. Sets the Content-Type |
| 107 | 116 | * header to application/x-www-form-urlencoded when no Content-Type header |
| @@ -106,14 +115,14 @@ | ||
| 106 | 115 | * where each value is a string or array of strings. Sets the Content-Type |
| 107 | 116 | * header to application/x-www-form-urlencoded when no Content-Type header |
| 108 | 117 | * is already present. |
| 109 | 118 | */ |
| 110 | - const FORM_PARAMS = 'form_params'; | |
| 119 | + public const FORM_PARAMS = 'form_params'; | |
| 111 | 120 | /** |
| 112 | 121 | * headers: (array) Associative array of HTTP headers. Each value MUST be |
| 113 | 122 | * a string or array of strings. |
| 114 | 123 | */ |
| 115 | - const HEADERS = 'headers'; | |
| 124 | + public const HEADERS = 'headers'; | |
| 116 | 125 | /** |
| 117 | 126 | * http_errors: (bool, default=true) Set to false to disable exceptions |
| 118 | 127 | * when a non- successful HTTP response is received. By default, |
| 119 | 128 | * exceptions will be thrown for 4xx and 5xx responses. This option only |
| @@ -118,9 +127,9 @@ | ||
| 118 | 127 | * when a non- successful HTTP response is received. By default, |
| 119 | 128 | * exceptions will be thrown for 4xx and 5xx responses. This option only |
| 120 | 129 | * works if your handler has the `httpErrors` middleware. |
| 121 | 130 | */ |
| 122 | - const HTTP_ERRORS = 'http_errors'; | |
| 131 | + public const HTTP_ERRORS = 'http_errors'; | |
| 123 | 132 | /** |
| 124 | 133 | * idn: (bool|int, default=true) A combination of IDNA_* constants for |
| 125 | 134 | * idn_to_ascii() PHP's function (see "options" parameter). Set to false to |
| 126 | 135 | * disable IDN support completely, or to true to use the default |
| @@ -125,15 +134,15 @@ | ||
| 125 | 134 | * idn_to_ascii() PHP's function (see "options" parameter). Set to false to |
| 126 | 135 | * disable IDN support completely, or to true to use the default |
| 127 | 136 | * configuration (IDNA_DEFAULT constant). |
| 128 | 137 | */ |
| 129 | - const IDN_CONVERSION = 'idn_conversion'; | |
| 138 | + public const IDN_CONVERSION = 'idn_conversion'; | |
| 130 | 139 | /** |
| 131 | 140 | * json: (mixed) Adds JSON data to a request. The provided value is JSON |
| 132 | 141 | * encoded and a Content-Type header of application/json will be added to |
| 133 | 142 | * the request if no Content-Type header is already present. |
| 134 | 143 | */ |
| 135 | - const JSON = 'json'; | |
| 144 | + public const JSON = 'json'; | |
| 136 | 145 | /** |
| 137 | 146 | * multipart: (array) Array of associative arrays, each containing a |
| 138 | 147 | * required "name" key mapping to the form field, name, a required |
| 139 | 148 | * "contents" key mapping to a StreamInterface|resource|string, an |
| @@ -141,15 +150,15 @@ | ||
| 141 | 150 | * optional "filename" key mapping to a string to send as the filename in |
| 142 | 151 | * the part. If no "filename" key is present, then no "filename" attribute |
| 143 | 152 | * will be added to the part. |
| 144 | 153 | */ |
| 145 | - const MULTIPART = 'multipart'; | |
| 154 | + public const MULTIPART = 'multipart'; | |
| 146 | 155 | /** |
| 147 | 156 | * on_headers: (callable) A callable that is invoked when the HTTP headers |
| 148 | 157 | * of the response have been received but the body has not yet begun to |
| 149 | 158 | * download. |
| 150 | 159 | */ |
| 151 | - const ON_HEADERS = 'on_headers'; | |
| 160 | + public const ON_HEADERS = 'on_headers'; | |
| 152 | 161 | /** |
| 153 | 162 | * on_stats: (callable) allows you to get access to transfer statistics of |
| 154 | 163 | * a request and access the lower level transfer details of the handler |
| 155 | 164 | * associated with your client. ``on_stats`` is a callable that is invoked |
| @@ -157,9 +166,9 @@ | ||
| 157 | 166 | * with transfer statistics about the request, the response received, or |
| 158 | 167 | * the error encountered. Included in the data is the total amount of time |
| 159 | 168 | * taken to send the request. |
| 160 | 169 | */ |
| 161 | - const ON_STATS = 'on_stats'; | |
| 170 | + public const ON_STATS = 'on_stats'; | |
| 162 | 171 | /** |
| 163 | 172 | * progress: (callable) Defines a function to invoke when transfer |
| 164 | 173 | * progress is made. The function accepts the following positional |
| 165 | 174 | * arguments: the total number of bytes expected to be downloaded, the |
| @@ -165,15 +174,15 @@ | ||
| 165 | 174 | * arguments: the total number of bytes expected to be downloaded, the |
| 166 | 175 | * number of bytes downloaded so far, the number of bytes expected to be |
| 167 | 176 | * uploaded, the number of bytes uploaded so far. |
| 168 | 177 | */ |
| 169 | - const PROGRESS = 'progress'; | |
| 178 | + public const PROGRESS = 'progress'; | |
| 170 | 179 | /** |
| 171 | 180 | * proxy: (string|array) Pass a string to specify an HTTP proxy, or an |
| 172 | 181 | * array to specify different proxies for different protocols (where the |
| 173 | 182 | * key is the protocol and the value is a proxy string). |
| 174 | 183 | */ |
| 175 | - const PROXY = 'proxy'; | |
| 184 | + public const PROXY = 'proxy'; | |
| 176 | 185 | /** |
| 177 | 186 | * query: (array|string) Associative array of query string values to add |
| 178 | 187 | * to the request. This option uses PHP's http_build_query() to create |
| 179 | 188 | * the string representation. Pass a string value if you need more |
| @@ -178,15 +187,15 @@ | ||
| 178 | 187 | * to the request. This option uses PHP's http_build_query() to create |
| 179 | 188 | * the string representation. Pass a string value if you need more |
| 180 | 189 | * control than what this method provides |
| 181 | 190 | */ |
| 182 | - const QUERY = 'query'; | |
| 191 | + public const QUERY = 'query'; | |
| 183 | 192 | /** |
| 184 | 193 | * sink: (resource|string|StreamInterface) Where the data of the |
| 185 | 194 | * response is written to. Defaults to a PHP temp stream. Providing a |
| 186 | 195 | * string will write data to a file by the given name. |
| 187 | 196 | */ |
| 188 | - const SINK = 'sink'; | |
| 197 | + public const SINK = 'sink'; | |
| 189 | 198 | /** |
| 190 | 199 | * synchronous: (bool) Set to true to inform HTTP handlers that you intend |
| 191 | 200 | * on waiting on the response. This can be useful for optimizations. Note |
| 192 | 201 | * that a promise is still returned if you are using one of the async |
| @@ -191,9 +200,9 @@ | ||
| 191 | 200 | * on waiting on the response. This can be useful for optimizations. Note |
| 192 | 201 | * that a promise is still returned if you are using one of the async |
| 193 | 202 | * client methods. |
| 194 | 203 | */ |
| 195 | - const SYNCHRONOUS = 'synchronous'; | |
| 204 | + public const SYNCHRONOUS = 'synchronous'; | |
| 196 | 205 | /** |
| 197 | 206 | * ssl_key: (array|string) Specify the path to a file containing a private |
| 198 | 207 | * SSL key in PEM format. If a password is required, then set to an array |
| 199 | 208 | * containing the path to the SSL key in the first array element followed |
| @@ -198,14 +207,14 @@ | ||
| 198 | 207 | * SSL key in PEM format. If a password is required, then set to an array |
| 199 | 208 | * containing the path to the SSL key in the first array element followed |
| 200 | 209 | * by the password required for the certificate in the second element. |
| 201 | 210 | */ |
| 202 | - const SSL_KEY = 'ssl_key'; | |
| 211 | + public const SSL_KEY = 'ssl_key'; | |
| 203 | 212 | /** |
| 204 | 213 | * stream: Set to true to attempt to stream a response rather than |
| 205 | 214 | * download it all up-front. |
| 206 | 215 | */ |
| 207 | - const STREAM = 'stream'; | |
| 216 | + public const STREAM = 'stream'; | |
| 208 | 217 | /** |
| 209 | 218 | * verify: (bool|string, default=true) Describes the SSL certificate |
| 210 | 219 | * verification behavior of a request. Set to true to enable SSL |
| 211 | 220 | * certificate verification using the system CA bundle when available |
| @@ -212,24 +221,24 @@ | ||
| 212 | 221 | * (the default). Set to false to disable certificate verification (this |
| 213 | 222 | * is insecure!). Set to a string to provide the path to a CA bundle on |
| 214 | 223 | * disk to enable verification using a custom certificate. |
| 215 | 224 | */ |
| 216 | - const VERIFY = 'verify'; | |
| 225 | + public const VERIFY = 'verify'; | |
| 217 | 226 | /** |
| 218 | 227 | * timeout: (float, default=0) Float describing the timeout of the |
| 219 | 228 | * request in seconds. Use 0 to wait indefinitely (the default behavior). |
| 220 | 229 | */ |
| 221 | - const TIMEOUT = 'timeout'; | |
| 230 | + public const TIMEOUT = 'timeout'; | |
| 222 | 231 | /** |
| 223 | 232 | * read_timeout: (float, default=default_socket_timeout ini setting) Float describing |
| 224 | 233 | * the body read timeout, for stream requests. |
| 225 | 234 | */ |
| 226 | - const READ_TIMEOUT = 'read_timeout'; | |
| 235 | + public const READ_TIMEOUT = 'read_timeout'; | |
| 227 | 236 | /** |
| 228 | 237 | * version: (float) Specifies the HTTP protocol version to attempt to use. |
| 229 | 238 | */ |
| 230 | - const VERSION = 'version'; | |
| 239 | + public const VERSION = 'version'; | |
| 231 | 240 | /** |
| 232 | 241 | * force_ip_resolve: (bool) Force client to use only ipv4 or ipv6 protocol |
| 233 | 242 | */ |
| 234 | - const FORCE_IP_RESOLVE = 'force_ip_resolve'; | |
| 243 | + public const FORCE_IP_RESOLVE = 'force_ip_resolve'; | |
| 235 | 244 | } |