From f4ae4c4b4549a43d606b4c61301f87111ce9d5d5 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Sun, 19 Apr 2020 07:49:54 +0200 Subject: [PATCH] Remove unnecessary and wrong definition of SoftDelete methods (#918) These two methods are already regular methods on the trait, there's no need to add them and additionally they're not static, so their definition was changed for the worse. The other methods are magic so it's fine to keep them. Fixes https://github.com/barryvdh/laravel-ide-helper/issues/917 --- src/Console/ModelsCommand.php | 3 --- tests/Console/ModelsCommand/SoftDeletes/Test.php | 2 -- 2 files changed, 5 deletions(-) diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index 1d56281..2cb12b2 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -843,9 +843,6 @@ class ModelsCommand extends Command { $traits = class_uses(get_class($model), true); if (in_array('Illuminate\\Database\\Eloquent\\SoftDeletes', $traits)) { - $this->setMethod('forceDelete', 'bool|null', []); - $this->setMethod('restore', 'bool|null', []); - $this->setMethod('withTrashed', '\Illuminate\Database\Query\Builder|\\' . get_class($model), []); $this->setMethod('withoutTrashed', '\Illuminate\Database\Query\Builder|\\' . get_class($model), []); $this->setMethod('onlyTrashed', '\Illuminate\Database\Query\Builder|\\' . get_class($model), []); diff --git a/tests/Console/ModelsCommand/SoftDeletes/Test.php b/tests/Console/ModelsCommand/SoftDeletes/Test.php index f451375..86dbcc1 100644 --- a/tests/Console/ModelsCommand/SoftDeletes/Test.php +++ b/tests/Console/ModelsCommand/SoftDeletes/Test.php @@ -62,12 +62,10 @@ use Illuminate\Database\Eloquent\SoftDeletes; * Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletes\Models\Simple * * @property integer $id - * @method static bool|null forceDelete() * @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletes\Models\Simple newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletes\Models\Simple newQuery() * @method static \Illuminate\Database\Query\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletes\Models\Simple onlyTrashed() * @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletes\Models\Simple query() - * @method static bool|null restore() * @method static \Illuminate\Database\Eloquent\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletes\Models\Simple whereId($value) * @method static \Illuminate\Database\Query\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletes\Models\Simple withTrashed() * @method static \Illuminate\Database\Query\Builder|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletes\Models\Simple withoutTrashed()