@@ -73,7 +73,7 @@ public function __construct(string|Stringable $url, string|Stringable|null $base
73
73
// 1. Let parsedURL be the result of running the API URL parser on url with base, if given.
74
74
$ parsedURL = self ::parseURL ($ url , $ base , $ this ->logger );
75
75
76
- if ($ parsedURL ->error === ParserErrorType ::NONE ) {
76
+ if ($ parsedURL ->error === APIParserErrorType ::NONE ) {
77
77
// 3. Initialize this with parsedURL.
78
78
assert ($ parsedURL ->url !== null );
79
79
self ::initializeURL ($ this , $ parsedURL ->url );
@@ -83,8 +83,8 @@ public function __construct(string|Stringable $url, string|Stringable|null $base
83
83
84
84
// 2. If parsedURL is failure, then throw a TypeError.
85
85
$ message = match ($ parsedURL ->error ) {
86
- ParserErrorType ::BASE => 'Invalid base URL ' ,
87
- ParserErrorType ::URL => 'Invalid URL '
86
+ APIParserErrorType ::BASE => 'Invalid base URL ' ,
87
+ APIParserErrorType ::URL => 'Invalid URL '
88
88
};
89
89
90
90
throw new TypeError ($ message );
@@ -109,7 +109,7 @@ public static function canParse(string|Stringable $url, string|Stringable|null $
109
109
{
110
110
$ parsedURL = self ::parseURL ($ url , $ base );
111
111
112
- return $ parsedURL ->error === ParserErrorType ::NONE ;
112
+ return $ parsedURL ->error === APIParserErrorType ::NONE ;
113
113
}
114
114
115
115
public function toString (): string
@@ -161,7 +161,7 @@ private static function parseURL(
161
161
162
162
// 2.2. If parsedBase is failure, then return failure.
163
163
if ($ parsedBase === false ) {
164
- return new APIParserResult (null , ParserErrorType ::BASE );
164
+ return new APIParserResult (null , APIParserErrorType ::BASE );
165
165
}
166
166
}
167
167
@@ -170,10 +170,10 @@ private static function parseURL(
170
170
$ parsedURL = $ parser ->parse (Utf8String::fromUnsafe ($ stringURL ), $ parsedBase );
171
171
172
172
if ($ parsedURL === false ) {
173
- return new APIParserResult (null , ParserErrorType ::URL );
173
+ return new APIParserResult (null , APIParserErrorType ::URL );
174
174
}
175
175
176
- return new APIParserResult ($ parsedURL , ParserErrorType ::NONE );
176
+ return new APIParserResult ($ parsedURL , APIParserErrorType ::NONE );
177
177
}
178
178
179
179
/**
0 commit comments