1 | <?php |
||
23 | class Url |
||
24 | { |
||
25 | /** |
||
26 | * @var string scheme |
||
27 | */ |
||
28 | protected $scheme; |
||
29 | |||
30 | /** |
||
31 | * @var Host Host object |
||
32 | */ |
||
33 | protected $host; |
||
34 | |||
35 | /** |
||
36 | * @var int port |
||
37 | */ |
||
38 | protected $port; |
||
39 | |||
40 | /** |
||
41 | * @var string user |
||
42 | */ |
||
43 | protected $user; |
||
44 | |||
45 | /** |
||
46 | * @var string pass |
||
47 | */ |
||
48 | protected $pass; |
||
49 | |||
50 | /** |
||
51 | * @var string path |
||
52 | */ |
||
53 | protected $path; |
||
54 | |||
55 | /** |
||
56 | * @var string query |
||
57 | */ |
||
58 | protected $query; |
||
59 | |||
60 | /** |
||
61 | * @var string fragment |
||
62 | */ |
||
63 | protected $fragment; |
||
64 | |||
65 | /** |
||
66 | * Public constructor. |
||
67 | * |
||
68 | * @param string $scheme The URL scheme (e.g. `http`). |
||
69 | * @param string $user The username. |
||
70 | * @param string $pass The password. |
||
71 | * @param Host $host The host elements. |
||
72 | * @param int $port The port number. |
||
73 | * @param string $path The path elements, including format. |
||
74 | * @param string $query The query elements. |
||
75 | * @param string $fragment The fragment. |
||
76 | */ |
||
77 | 10 | public function __construct( |
|
99 | |||
100 | /** |
||
101 | * Gets schemeless url. |
||
102 | * |
||
103 | * @return string Url without scheme |
||
104 | */ |
||
105 | 1 | public function getSchemeless(): string |
|
109 | |||
110 | /** |
||
111 | * Converts the URI object to a string and returns it. |
||
112 | * |
||
113 | * @return string The full URI this object represents. |
||
114 | */ |
||
115 | 7 | public function __toString() |
|
155 | |||
156 | /** |
||
157 | * Converts the URI object to an array and returns it. |
||
158 | * |
||
159 | * @return array Array of URI component parts |
||
160 | */ |
||
161 | 1 | public function toArray(): array |
|
177 | |||
178 | /** |
||
179 | * Get Scheme. |
||
180 | * |
||
181 | * @return string|null |
||
182 | */ |
||
183 | 2 | public function getScheme() |
|
187 | |||
188 | /** |
||
189 | * Get User. |
||
190 | * |
||
191 | * @return string|null |
||
192 | */ |
||
193 | 1 | public function getUser() |
|
197 | |||
198 | /** |
||
199 | * Get Pass. |
||
200 | * |
||
201 | * @return string|null |
||
202 | */ |
||
203 | 1 | public function getPass() |
|
207 | |||
208 | /** |
||
209 | * Get Host object. |
||
210 | * |
||
211 | * @return Host |
||
212 | */ |
||
213 | 1 | public function getHost(): Host |
|
217 | |||
218 | /** |
||
219 | * Get Port. |
||
220 | * |
||
221 | * @return int|null |
||
222 | */ |
||
223 | 1 | public function getPort() |
|
227 | |||
228 | /** |
||
229 | * Get Path. |
||
230 | * |
||
231 | * @return string|null |
||
232 | */ |
||
233 | 1 | public function getPath() |
|
237 | |||
238 | /** |
||
239 | * Get Query. |
||
240 | * |
||
241 | * @return string|null |
||
242 | */ |
||
243 | 1 | public function getQuery() |
|
247 | |||
248 | /** |
||
249 | * Get Fragment. |
||
250 | * |
||
251 | * @return string|null |
||
252 | */ |
||
253 | 1 | public function getFragment() |
|
257 | } |
||
258 |