shalvah 2 år sedan
förälder
incheckning
185b327dd8

+ 0 - 1
phpstan.neon

@@ -14,7 +14,6 @@ parameters:
         - '#Access to an undefined property Illuminate\\Contracts\\Foundation\\Application::\$view#'
         - '#Unsafe usage of new static#'
         - '#Dead catch#'
-        - '/Call to an undefined static method Illuminate\\Database\\Eloquent\\Model::first\(\)/'
         - '/Call to an undefined method League\\Flysystem\\Filesystem::deleteDir\(\)./'
         - '/Instantiated class League\\Flysystem\\Adapter\\Local not found./'
         - '/Parameter #1 \$adapter of class League\\Flysystem\\Filesystem constructor expects League\\Flysystem\\FilesystemAdapter, League\\Flysystem\\Adapter\\Local given./'

+ 1 - 1
src/Extracting/UrlParamsNormalizer.php

@@ -100,7 +100,7 @@ class UrlParamsNormalizer
      *
      * @param \Illuminate\Routing\Route $route
      * @param string $paramName The name of the URL parameter
-     * @param array $typeHintedArguments Arguments to the method that have typehints
+     * @param array<string, Model> $typeHintedEloquentModels
      * @param string|null $default Default field to use
      *
      * @return string|null

+ 1 - 2
tests/GenerateDocumentationTest.php

@@ -398,8 +398,7 @@ class GenerateDocumentationTest extends BaseLaravelTest
     public function generates_correct_url_params_from_resource_routes_and_field_bindings()
     {
         if (version_compare($this->app->version(), '7.0.0', '<')) {
-            $this->markTestSkipped("Laravel < 7.x doesn't support field binding syntax.");
-
+            $this->markTestSkipped("Field binding syntax was introduced in Laravel 7.");
             return;
         }
 

+ 1 - 2
tests/Strategies/UrlParameters/GetFromLaravelAPITest.php

@@ -105,8 +105,7 @@ class GetFromLaravelAPITest extends BaseLaravelTest
     public function can_infer_data_from_field_bindings()
     {
         if (version_compare($this->app->version(), '7.0.0', '<')) {
-            $this->markTestSkipped("Laravel < 7.x doesn't support field binding syntax.");
-
+            $this->markTestSkipped("Field binding syntax was introduced in Laravel 7.");
             return;
         }
 

+ 5 - 0
tests/Unit/ExtractedEndpointDataTest.php

@@ -41,6 +41,11 @@ class ExtractedEndpointDataTest extends BaseLaravelTest
     /** @test */
     public function normalizes_nonresource_url_params_with_inline_bindings()
     {
+        if (version_compare($this->app->version(), '7.0.0', '<')) {
+            $this->markTestSkipped("Field binding syntax was introduced in Laravel 7.");
+            return;
+        }
+
         Route::get('things/{thing:slug}', [TestController::class, 'show']);
         $route = $this->getRoute(['prefixes' => '*']);