1 | <?php |
||
8 | class Scheme extends AbstractUriPart |
||
9 | { |
||
10 | protected static $compositions = array(); |
||
11 | |||
12 | /** @noinspection PhpMissingParentConstructorInspection */ |
||
13 | /** |
||
14 | * Scheme constructor. Accepts a string representing a URI scheme. Construction will throw an exception if the |
||
15 | * scheme is either not a string or does not conform to the RFC3986 URI scheme specification. |
||
16 | * |
||
17 | * Construction also results in the scheme string being converted to lowercase per RFC3986. |
||
18 | * |
||
19 | * scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) |
||
20 | * |
||
21 | * @see https://tools.ietf.org/html/rfc3986#section-3.1 |
||
22 | * @see https://tools.ietf.org/html/rfc3986#appendix-A |
||
23 | * |
||
24 | * @throws \InvalidArgumentException |
||
25 | * |
||
26 | * @param string $scheme A string representing a URI scheme |
||
27 | */ |
||
28 | 78 | public function __construct($scheme) |
|
40 | |||
41 | /** |
||
42 | * Returns a string representation of the scheme formatted so that it can be compiled into a complete URI string |
||
43 | * per the Uri object's string specification. |
||
44 | * |
||
45 | * If the scheme is empty, toUriString returns an empty string; if the scheme is not empty, toUriString returns the |
||
46 | * scheme suffixed with a colon. |
||
47 | * |
||
48 | * @see Uri::__toString |
||
49 | * |
||
50 | * @return string A string representation of the scheme formatted for a complete URI string |
||
51 | */ |
||
52 | 18 | public function toUriString() |
|
62 | |||
63 | /** |
||
64 | * Compiles a regexp pattern based on predefined patterns that define allowed characters for a scheme. |
||
65 | */ |
||
66 | 86 | protected static function compileValidPattern() |
|
71 | } |
||
72 |