File tree Expand file tree Collapse file tree 2 files changed +19
-11
lines changed Expand file tree Collapse file tree 2 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,13 @@ public static function parseUrl(string $url):array|null{
173173 return null ;
174174 }
175175
176- return array_map ('urldecode ' , $ result );
176+ $ parsed = array_map ('urldecode ' , $ result );
177+
178+ if (isset ($ parsed ['port ' ])){
179+ $ parsed ['port ' ] = (int )$ parsed ['port ' ];
180+ }
181+
182+ return $ parsed ;
177183 }
178184
179185}
Original file line number Diff line number Diff line change @@ -134,18 +134,20 @@ public static function parseUrlProvider():array{
134134 return [
135135 ['http:// ' , null ],
136136 [
137- 'https://яндекAс.рф ' , [
138- 'scheme ' => 'https ' ,
139- 'host ' => 'яндекAс.рф ' ,
140- ],
137+ 'https://яндекAс.рф ' ,
138+ [
139+ 'scheme ' => 'https ' ,
140+ 'host ' => 'яндекAс.рф ' ,
141+ ],
141142 ],
142143 [
143- 'http://[2a00:f48:1008::212:183:10]:56?foo=bar ' , [
144- 'scheme ' => 'http ' ,
145- 'host ' => '[2a00:f48:1008::212:183:10] ' ,
146- 'port ' => '56 ' ,
147- 'query ' => 'foo=bar ' ,
148- ],
144+ 'http://[2a00:f48:1008::212:183:10]:56?foo=bar ' ,
145+ [
146+ 'scheme ' => 'http ' ,
147+ 'host ' => '[2a00:f48:1008::212:183:10] ' ,
148+ 'port ' => 56 ,
149+ 'query ' => 'foo=bar ' ,
150+ ],
149151 ],
150152 ];
151153 }
You can’t perform that action at this time.
0 commit comments