-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Expand file tree
/
Copy pathphp_uri.stub.php
More file actions
286 lines (200 loc) · 8.11 KB
/
Copy pathphp_uri.stub.php
File metadata and controls
286 lines (200 loc) · 8.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<?php
/**
* @generate-class-entries
* @generate-c-enums
*/
namespace Uri {
/** @strict-properties */
class UriException extends \Exception
{
}
/** @strict-properties */
class UriError extends \Error
{
}
/** @strict-properties */
class InvalidUriException extends \Uri\UriException
{
}
enum UriComparisonMode
{
case IncludeFragment;
case ExcludeFragment;
}
}
namespace Uri\Rfc3986 {
enum UriType
{
case AbsolutePathReference;
case RelativePathReference;
case NetworkPathReference;
case Uri;
}
enum UriHostType
{
case IPv4;
case IPv6;
case IPvFuture;
case RegisteredName;
}
final class UriBuilder
{
private ?string $scheme = null;
private ?string $userinfo = null;
private ?string $host = null;
private ?int $port = null;
private string $path = "";
private ?string $query = null;
private ?string $fragment = null;
public function reset(): static {}
public function setScheme(?string $scheme): static {}
public function setUserInfo(#[\SensitiveParameter] ?string $userInfo): static {}
public function setHost(?string $host): static {}
public function setPort(?int $port): static {}
public function setPath(string $path): static {}
public function setQuery(?string $query): static {}
public function setFragment(?string $fragment): static {}
public function build(?\Uri\Rfc3986\Uri $baseUrl = null): \Uri\Rfc3986\Uri {}
}
/** @strict-properties */
final readonly class Uri
{
public static function parse(string $uri, ?\Uri\Rfc3986\Uri $baseUrl = null): ?static {}
public function __construct(string $uri, ?\Uri\Rfc3986\Uri $baseUrl = null) {}
public function getUriType(): ?\Uri\Rfc3986\UriType {}
public function getScheme(): ?string {}
public function getRawScheme(): ?string {}
public function withScheme(?string $scheme): static {}
public function getUserInfo(): ?string {}
public function getRawUserInfo(): ?string {}
public function withUserInfo(#[\SensitiveParameter] ?string $userinfo): static {}
public function getUsername(): ?string {}
public function getRawUsername(): ?string {}
public function getPassword(): ?string {}
public function getRawPassword(): ?string {}
public function getHost(): ?string {}
public function getRawHost(): ?string {}
public function getHostType(): ?\Uri\Rfc3986\UriHostType {}
public function withHost(?string $host): static {}
public function getPort(): ?int {}
public function withPort(?int $port): static {}
public function getPath(): string {}
public function getRawPath(): string {}
public function withPath(string $path): static {}
public function getQuery(): ?string {}
public function getRawQuery(): ?string {}
public function withQuery(?string $query): static {}
public function getFragment(): ?string {}
public function getRawFragment(): ?string {}
public function withFragment(?string $fragment): static {}
public function equals(\Uri\Rfc3986\Uri $uri, \Uri\UriComparisonMode $comparisonMode = \Uri\UriComparisonMode::ExcludeFragment): bool {}
public function toString(): string {}
public function toRawString(): string {}
public function resolve(string $uri): static {}
public function __serialize(): array {}
public function __unserialize(array $data): void {}
public function __debugInfo(): array {}
}
}
namespace Uri\WhatWg {
/** @strict-properties */
class InvalidUrlException extends \Uri\InvalidUriException
{
public readonly array $errors;
public function __construct(string $message = "", array $errors = [], int $code = 0, ?\Throwable $previous = null) {}
}
enum UrlValidationErrorType
{
case DomainToAscii;
case DomainToUnicode;
case DomainInvalidCodePoint;
case HostInvalidCodePoint;
case Ipv4EmptyPart;
case Ipv4TooManyParts;
case Ipv4NonNumericPart;
case Ipv4NonDecimalPart;
case Ipv4OutOfRangePart;
case Ipv6Unclosed;
case Ipv6InvalidCompression;
case Ipv6TooManyPieces;
case Ipv6MultipleCompression;
case Ipv6InvalidCodePoint;
case Ipv6TooFewPieces;
case Ipv4InIpv6TooManyPieces;
case Ipv4InIpv6InvalidCodePoint;
case Ipv4InIpv6OutOfRangePart;
case Ipv4InIpv6TooFewParts;
case InvalidUrlUnit;
case SpecialSchemeMissingFollowingSolidus;
case MissingSchemeNonRelativeUrl;
case InvalidReverseSoldius;
case InvalidCredentials;
case HostMissing;
case PortOutOfRange;
case PortInvalid;
case FileInvalidWindowsDriveLetter;
case FileInvalidWindowsDriveLetterHost;
}
/** @strict-properties */
final readonly class UrlValidationError
{
public string $context;
public \Uri\WhatWg\UrlValidationErrorType $type;
public bool $failure;
public function __construct(string $context, \Uri\WhatWg\UrlValidationErrorType $type, bool $failure) {}
}
enum UrlHostType
{
case IPv4;
case IPv6;
case Domain;
case Opaque;
case Empty;
}
/** @strict-properties */
final readonly class Url
{
/** @param array $errors */
public static function parse(string $uri, ?\Uri\WhatWg\Url $baseUrl = null, &$errors = null): ?static {}
/** @param array $softErrors */
public function __construct(string $uri, ?\Uri\WhatWg\Url $baseUrl = null, &$softErrors = null) {}
public function getScheme(): string {}
public function withScheme(string $scheme): static {}
public function isSpecialScheme(): bool {}
/** @implementation-alias Uri\Rfc3986\Uri::getUsername */
public function getUsername(): ?string {}
public function withUsername(?string $username): static {}
/** @implementation-alias Uri\Rfc3986\Uri::getPassword */
public function getPassword(): ?string {}
public function withPassword(#[\SensitiveParameter] ?string $password): static {}
public function getAsciiHost(): ?string {}
public function getUnicodeHost(): ?string {}
public function getHostType(): ?\Uri\WhatWg\UrlHostType {}
/** @implementation-alias Uri\Rfc3986\Uri::withHost */
public function withHost(?string $host): static {}
/** @implementation-alias Uri\Rfc3986\Uri::getPort */
public function getPort(): ?int {}
/** @implementation-alias Uri\Rfc3986\Uri::withPort */
public function withPort(?int $port): static {}
/** @implementation-alias Uri\Rfc3986\Uri::getPath */
public function getPath(): string {}
/** @implementation-alias Uri\Rfc3986\Uri::withPath */
public function withPath(string $path): static {}
/** @implementation-alias Uri\Rfc3986\Uri::getQuery */
public function getQuery(): ?string {}
/** @implementation-alias Uri\Rfc3986\Uri::withQuery */
public function withQuery(?string $query): static {}
/** @implementation-alias Uri\Rfc3986\Uri::getFragment */
public function getFragment(): ?string {}
/** @implementation-alias Uri\Rfc3986\Uri::withFragment */
public function withFragment(?string $fragment): static {}
public function equals(\Uri\WhatWg\Url $url, \Uri\UriComparisonMode $comparisonMode = \Uri\UriComparisonMode::ExcludeFragment): bool {}
public function toAsciiString(): string {}
public function toUnicodeString(): string {}
/** @param array $softErrors */
public function resolve(string $uri, &$softErrors = null): static {}
public function __serialize(): array {}
public function __unserialize(array $data): void {}
public function __debugInfo(): array {}
}
}