Cookie
2 years ago
Exception
2 years ago
Handler
2 years ago
BodySummarizer.php
2 years ago
BodySummarizerInterface.php
2 years ago
Client.php
2 years ago
ClientInterface.php
2 years ago
ClientTrait.php
2 years ago
HandlerStack.php
2 years ago
MessageFormatter.php
2 years ago
MessageFormatterInterface.php
2 years ago
Middleware.php
2 years ago
Pool.php
2 years ago
PrepareBodyMiddleware.php
2 years ago
RedirectMiddleware.php
2 years ago
RequestOptions.php
2 years ago
RetryMiddleware.php
2 years ago
TransferStats.php
2 years ago
Utils.php
2 years ago
functions.php
2 years ago
functions_include.php
2 years ago
functions.php
159 lines
| 1 | <?php |
| 2 | |
| 3 | namespace YoastSEO_Vendor\GuzzleHttp; |
| 4 | |
| 5 | /** |
| 6 | * Debug function used to describe the provided value type and class. |
| 7 | * |
| 8 | * @param mixed $input Any type of variable to describe the type of. This |
| 9 | * parameter misses a typehint because of that. |
| 10 | * |
| 11 | * @return string Returns a string containing the type of the variable and |
| 12 | * if a class is provided, the class name. |
| 13 | * |
| 14 | * @deprecated describe_type will be removed in guzzlehttp/guzzle:8.0. Use Utils::describeType instead. |
| 15 | */ |
| 16 | function describe_type($input) : string |
| 17 | { |
| 18 | return \YoastSEO_Vendor\GuzzleHttp\Utils::describeType($input); |
| 19 | } |
| 20 | /** |
| 21 | * Parses an array of header lines into an associative array of headers. |
| 22 | * |
| 23 | * @param iterable $lines Header lines array of strings in the following |
| 24 | * format: "Name: Value" |
| 25 | * |
| 26 | * @deprecated headers_from_lines will be removed in guzzlehttp/guzzle:8.0. Use Utils::headersFromLines instead. |
| 27 | */ |
| 28 | function headers_from_lines(iterable $lines) : array |
| 29 | { |
| 30 | return \YoastSEO_Vendor\GuzzleHttp\Utils::headersFromLines($lines); |
| 31 | } |
| 32 | /** |
| 33 | * Returns a debug stream based on the provided variable. |
| 34 | * |
| 35 | * @param mixed $value Optional value |
| 36 | * |
| 37 | * @return resource |
| 38 | * |
| 39 | * @deprecated debug_resource will be removed in guzzlehttp/guzzle:8.0. Use Utils::debugResource instead. |
| 40 | */ |
| 41 | function debug_resource($value = null) |
| 42 | { |
| 43 | return \YoastSEO_Vendor\GuzzleHttp\Utils::debugResource($value); |
| 44 | } |
| 45 | /** |
| 46 | * Chooses and creates a default handler to use based on the environment. |
| 47 | * |
| 48 | * The returned handler is not wrapped by any default middlewares. |
| 49 | * |
| 50 | * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system. |
| 51 | * |
| 52 | * @throws \RuntimeException if no viable Handler is available. |
| 53 | * |
| 54 | * @deprecated choose_handler will be removed in guzzlehttp/guzzle:8.0. Use Utils::chooseHandler instead. |
| 55 | */ |
| 56 | function choose_handler() : callable |
| 57 | { |
| 58 | return \YoastSEO_Vendor\GuzzleHttp\Utils::chooseHandler(); |
| 59 | } |
| 60 | /** |
| 61 | * Get the default User-Agent string to use with Guzzle. |
| 62 | * |
| 63 | * @deprecated default_user_agent will be removed in guzzlehttp/guzzle:8.0. Use Utils::defaultUserAgent instead. |
| 64 | */ |
| 65 | function default_user_agent() : string |
| 66 | { |
| 67 | return \YoastSEO_Vendor\GuzzleHttp\Utils::defaultUserAgent(); |
| 68 | } |
| 69 | /** |
| 70 | * Returns the default cacert bundle for the current system. |
| 71 | * |
| 72 | * First, the openssl.cafile and curl.cainfo php.ini settings are checked. |
| 73 | * If those settings are not configured, then the common locations for |
| 74 | * bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X |
| 75 | * and Windows are checked. If any of these file locations are found on |
| 76 | * disk, they will be utilized. |
| 77 | * |
| 78 | * Note: the result of this function is cached for subsequent calls. |
| 79 | * |
| 80 | * @throws \RuntimeException if no bundle can be found. |
| 81 | * |
| 82 | * @deprecated default_ca_bundle will be removed in guzzlehttp/guzzle:8.0. This function is not needed in PHP 5.6+. |
| 83 | */ |
| 84 | function default_ca_bundle() : string |
| 85 | { |
| 86 | return \YoastSEO_Vendor\GuzzleHttp\Utils::defaultCaBundle(); |
| 87 | } |
| 88 | /** |
| 89 | * Creates an associative array of lowercase header names to the actual |
| 90 | * header casing. |
| 91 | * |
| 92 | * @deprecated normalize_header_keys will be removed in guzzlehttp/guzzle:8.0. Use Utils::normalizeHeaderKeys instead. |
| 93 | */ |
| 94 | function normalize_header_keys(array $headers) : array |
| 95 | { |
| 96 | return \YoastSEO_Vendor\GuzzleHttp\Utils::normalizeHeaderKeys($headers); |
| 97 | } |
| 98 | /** |
| 99 | * Returns true if the provided host matches any of the no proxy areas. |
| 100 | * |
| 101 | * This method will strip a port from the host if it is present. Each pattern |
| 102 | * can be matched with an exact match (e.g., "foo.com" == "foo.com") or a |
| 103 | * partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" == |
| 104 | * "baz.foo.com", but ".foo.com" != "foo.com"). |
| 105 | * |
| 106 | * Areas are matched in the following cases: |
| 107 | * 1. "*" (without quotes) always matches any hosts. |
| 108 | * 2. An exact match. |
| 109 | * 3. The area starts with "." and the area is the last part of the host. e.g. |
| 110 | * '.mit.edu' will match any host that ends with '.mit.edu'. |
| 111 | * |
| 112 | * @param string $host Host to check against the patterns. |
| 113 | * @param string[] $noProxyArray An array of host patterns. |
| 114 | * |
| 115 | * @throws Exception\InvalidArgumentException |
| 116 | * |
| 117 | * @deprecated is_host_in_noproxy will be removed in guzzlehttp/guzzle:8.0. Use Utils::isHostInNoProxy instead. |
| 118 | */ |
| 119 | function is_host_in_noproxy(string $host, array $noProxyArray) : bool |
| 120 | { |
| 121 | return \YoastSEO_Vendor\GuzzleHttp\Utils::isHostInNoProxy($host, $noProxyArray); |
| 122 | } |
| 123 | /** |
| 124 | * Wrapper for json_decode that throws when an error occurs. |
| 125 | * |
| 126 | * @param string $json JSON data to parse |
| 127 | * @param bool $assoc When true, returned objects will be converted |
| 128 | * into associative arrays. |
| 129 | * @param int $depth User specified recursion depth. |
| 130 | * @param int $options Bitmask of JSON decode options. |
| 131 | * |
| 132 | * @return object|array|string|int|float|bool|null |
| 133 | * |
| 134 | * @throws Exception\InvalidArgumentException if the JSON cannot be decoded. |
| 135 | * |
| 136 | * @see https://www.php.net/manual/en/function.json-decode.php |
| 137 | * @deprecated json_decode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonDecode instead. |
| 138 | */ |
| 139 | function json_decode(string $json, bool $assoc = \false, int $depth = 512, int $options = 0) |
| 140 | { |
| 141 | return \YoastSEO_Vendor\GuzzleHttp\Utils::jsonDecode($json, $assoc, $depth, $options); |
| 142 | } |
| 143 | /** |
| 144 | * Wrapper for JSON encoding that throws when an error occurs. |
| 145 | * |
| 146 | * @param mixed $value The value being encoded |
| 147 | * @param int $options JSON encode option bitmask |
| 148 | * @param int $depth Set the maximum depth. Must be greater than zero. |
| 149 | * |
| 150 | * @throws Exception\InvalidArgumentException if the JSON cannot be encoded. |
| 151 | * |
| 152 | * @see https://www.php.net/manual/en/function.json-encode.php |
| 153 | * @deprecated json_encode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonEncode instead. |
| 154 | */ |
| 155 | function json_encode($value, int $options = 0, int $depth = 512) : string |
| 156 | { |
| 157 | return \YoastSEO_Vendor\GuzzleHttp\Utils::jsonEncode($value, $options, $depth); |
| 158 | } |
| 159 |