File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 2020 },
2121 "require" : {
2222 "php" : " >=8.1" ,
23- "league/uri" : " ^7.4 " ,
24- "league/uri-interfaces" : " ^7.4 "
23+ "league/uri" : " ^7.6 " ,
24+ "league/uri-interfaces" : " ^7.6 "
2525 },
2626 "require-dev" : {
2727 "phpstan/phpstan" : " ^2.0" ,
Original file line number Diff line number Diff line change 22
33namespace SourceSpan ;
44
5- use League \Uri \BaseUri ;
65use League \Uri \Contracts \UriInterface ;
6+ use League \Uri \Uri ;
77
88/**
99 * @internal
@@ -349,10 +349,14 @@ public static function prettyUri(string|UriInterface $path): string
349349
350350 private static function pathFromUri (UriInterface $ uri ): string
351351 {
352+ if (!$ uri instanceof Uri) {
353+ $ uri = Uri::new ($ uri );
354+ }
355+
352356 if (\DIRECTORY_SEPARATOR === '\\' ) {
353- return BaseUri:: from ( $ uri)-> windowsPath () ?? throw new \InvalidArgumentException ("Uri $ uri must have scheme 'file:'. " );
357+ return $ uri-> toWindowsPath () ?? throw new \InvalidArgumentException ("Uri $ uri must have scheme 'file:'. " );
354358 }
355359
356- return BaseUri:: from ( $ uri)-> unixPath () ?? throw new \InvalidArgumentException ("Uri $ uri must have scheme 'file:'. " );
360+ return $ uri-> toUnixPath () ?? throw new \InvalidArgumentException ("Uri $ uri must have scheme 'file:'. " );
357361 }
358362}
You can’t perform that action at this time.
0 commit comments