1 | <?php |
||
15 | class SchemeRegistry |
||
16 | { |
||
17 | /** |
||
18 | * The schemes. |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | protected static $schemes = [ |
||
23 | 'http' => 80, |
||
24 | 'https' => 443, |
||
25 | ]; |
||
26 | |||
27 | /** |
||
28 | * Register scheme. |
||
29 | * |
||
30 | * @param string $scheme |
||
31 | * @param int|string $port |
||
32 | * |
||
33 | * @throws \InvalidArgumentException |
||
34 | */ |
||
35 | public static function registerScheme($scheme, $port) |
||
47 | |||
48 | /** |
||
49 | * Register schemes. |
||
50 | * |
||
51 | * @param array $schemes |
||
52 | * |
||
53 | * @throws \InvalidArgumentException |
||
54 | */ |
||
55 | public static function registerSchemes(array $schemes) |
||
61 | |||
62 | /** |
||
63 | * Return whether or not the scheme is registered. |
||
64 | * |
||
65 | * @param string $scheme |
||
66 | * |
||
67 | * @return bool |
||
68 | * @throws \InvalidArgumentException |
||
69 | */ |
||
70 | public static function isSchemeRegistered($scheme) |
||
78 | |||
79 | /** |
||
80 | * Return whether or not the port is the standard port of the scheme. |
||
81 | * |
||
82 | * @param string $scheme |
||
83 | * @param int|string $port |
||
84 | * |
||
85 | * @return bool |
||
86 | * @throws \InvalidArgumentException |
||
87 | */ |
||
88 | public static function isStandardPort($scheme, $port) |
||
100 | } |
||
101 |