소스 검색

Fix URL::useOrigin/forceRootURL

Shalvah 2 달 전
부모
커밋
956e9bf418
1개의 변경된 파일3개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 4
      src/Commands/GenerateDocumentation.php

+ 3 - 4
src/Commands/GenerateDocumentation.php

@@ -122,11 +122,10 @@ class GenerateDocumentation extends Command
         $baseUrl = $this->docConfig->get('base_url') ?? config('app.url');
 
         /* @phpstan-ignore-next-line */
-        if (version_compare(Application::VERSION, '11.0', '>=')) {
-            // Renamed in Laravel 11
+        try {
+            // Renamed from forceRootUrl in Laravel 11.43 or so
             URL::useOrigin($baseUrl);
-        } else {
-            /* @phpstan-ignore-next-line */
+        } catch (\BadMethodCallException) {
             URL::forceRootUrl($baseUrl);
         }