PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.6
Booking for Appointments and Events Calendar – Amelia v2.4.6
2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / guzzlehttp / guzzle / src / Handler / HeaderProcessor.php
ameliabooking / vendor / guzzlehttp / guzzle / src / Handler Last commit date
CurlFactory.php 7 months ago CurlFactoryInterface.php 7 months ago CurlHandler.php 7 months ago CurlMultiHandler.php 7 months ago EasyHandle.php 7 months ago HeaderProcessor.php 7 months ago MockHandler.php 7 months ago Proxy.php 7 months ago StreamHandler.php 7 months ago
HeaderProcessor.php
43 lines
1 <?php
2
3 namespace AmeliaVendor\GuzzleHttp\Handler;
4
5 use AmeliaVendor\GuzzleHttp\Utils;
6
7 /**
8 * @internal
9 */
10 final class HeaderProcessor
11 {
12 /**
13 * Returns the HTTP version, status code, reason phrase, and headers.
14 *
15 * @param string[] $headers
16 *
17 * @return array{0:string, 1:int, 2:?string, 3:array}
18 *
19 * @throws \RuntimeException
20 */
21 public static function parseHeaders(array $headers): array
22 {
23 if ($headers === []) {
24 throw new \RuntimeException('Expected a non-empty array of header data');
25 }
26
27 $parts = \explode(' ', \array_shift($headers), 3);
28 $version = \explode('/', $parts[0])[1] ?? null;
29
30 if ($version === null) {
31 throw new \RuntimeException('HTTP version missing from header data');
32 }
33
34 $status = $parts[1] ?? null;
35
36 if ($status === null) {
37 throw new \RuntimeException('HTTP status code missing from header data');
38 }
39
40 return [$version, (int) $status, $parts[2] ?? null, Utils::headersFromLines($headers)];
41 }
42 }
43