From ff54a20d2189c015b11ebb310b46cddb18a8bab3 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Fri, 4 Dec 2020 09:22:58 +0100 Subject: [PATCH] Fix CS --- src/Console/ModelsCommand.php | 2 +- .../ExtendedSelfCastingCasterWithStaticDocblockReturn.php | 3 --- .../Casts/ExtendedSelfCastingCasterWithThisDocblockReturn.php | 3 --- .../ModelsCommand/LaravelCustomCasts/Models/CustomCast.php | 2 +- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index 1fed401..4a21a43 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -1108,7 +1108,7 @@ class ModelsCommand extends Command if ($reflectionType === null) { $reflectionType = $this->getReturnTypeFromDocBlock($methodReflection); } - + if($reflectionType === 'static' || $reflectionType === '$this') { $reflectionType = $type; } diff --git a/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/ExtendedSelfCastingCasterWithStaticDocblockReturn.php b/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/ExtendedSelfCastingCasterWithStaticDocblockReturn.php index 1196566..8d11234 100644 --- a/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/ExtendedSelfCastingCasterWithStaticDocblockReturn.php +++ b/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/ExtendedSelfCastingCasterWithStaticDocblockReturn.php @@ -4,9 +4,6 @@ declare(strict_types=1); namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Casts; -use Illuminate\Contracts\Database\Eloquent\CastsAttributes; - class ExtendedSelfCastingCasterWithStaticDocblockReturn extends SelfCastingCasterWithStaticDocblockReturn { - } diff --git a/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/ExtendedSelfCastingCasterWithThisDocblockReturn.php b/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/ExtendedSelfCastingCasterWithThisDocblockReturn.php index 8c336b2..e9551cd 100644 --- a/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/ExtendedSelfCastingCasterWithThisDocblockReturn.php +++ b/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/ExtendedSelfCastingCasterWithThisDocblockReturn.php @@ -4,9 +4,6 @@ declare(strict_types=1); namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Casts; -use Illuminate\Contracts\Database\Eloquent\CastsAttributes; - class ExtendedSelfCastingCasterWithThisDocblockReturn extends SelfCastingCasterWithStaticDocblockReturn { - } diff --git a/tests/Console/ModelsCommand/LaravelCustomCasts/Models/CustomCast.php b/tests/Console/ModelsCommand/LaravelCustomCasts/Models/CustomCast.php index a2adac6..6b7bf2b 100644 --- a/tests/Console/ModelsCommand/LaravelCustomCasts/Models/CustomCast.php +++ b/tests/Console/ModelsCommand/LaravelCustomCasts/Models/CustomCast.php @@ -33,6 +33,6 @@ class CustomCast extends Model 'casted_property_with_this_return_docblock' => SelfCastingCasterWithThisDocblockReturn::class, 'extended_casted_property_with_static_return_docblock' => ExtendedSelfCastingCasterWithStaticDocblockReturn::class, 'extended_casted_property_with_this_return_docblock' => ExtendedSelfCastingCasterWithThisDocblockReturn::class, - 'casted_property_with_static_return_docblock_and_param' => SelfCastingCasterWithStaticDocblockReturn::class .':param', + 'casted_property_with_static_return_docblock_and_param' => SelfCastingCasterWithStaticDocblockReturn::class . ':param', ]; }