diff --git a/CHANGELOG.md b/CHANGELOG.md index 229b2ba..bd2eed1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ All notable changes to this project will be documented in this file. - Support for Laravel 11 [#1520 / KentarouTakeda](https://github.com/barryvdh/laravel-ide-helper/pull/1520) ### Changed -- Merge --reset and --smart-reset, to always keep the text. Always skipp the classname [#1523 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1523) +- Make `--reset` always keep the text and remove `--smart-reset`. Always skip the classname [#1523 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1523) & [#1525 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1525) - Use short types (`int` and `bool` instead of `integer` and `boolean`) [#1524 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1524) ### Removed diff --git a/README.md b/README.md index 49964db..b28c0dd 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ The class name will be different from the model, avoiding the IDE duplicate anno Writing to the models should keep the existing comments and only append new properties/methods. It will not update changed properties/methods. -With the `--reset (-R)` option, the whole existing PHPDoc is replaced, including any comments that have been made. The `--smart-reset` option will instead keep the 'text' part of the phpdoc comment, and just replace all the property/method defininitions. +With the `--reset (-R)` option, the whole existing PHPDoc is replaced, including any comments that have been made. ```bash php artisan ide-helper:models "App\Models\Post" diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index b6082d1..d2d484f 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -150,7 +150,7 @@ class ModelsCommand extends Command ); $model = $this->argument('model'); $ignore = $this->option('ignore'); - $this->reset = $this->option('reset') || $this->option('smart-reset'); + $this->reset = $this->option('reset'); $this->phpstorm_noinspections = $this->option('phpstorm-noinspections'); $this->write_model_magic_where = $this->laravel['config']->get('ide-helper.write_model_magic_where', true); $this->write_model_external_builder_methods = $this->laravel['config']->get('ide-helper.write_model_external_builder_methods', true); @@ -215,7 +215,6 @@ class ModelsCommand extends Command ], ['nowrite', 'N', InputOption::VALUE_NONE, 'Don\'t write to Model file'], ['reset', 'R', InputOption::VALUE_NONE, 'Refresh the properties/methods list, but keep the text'], - ['smart-reset', 'r', InputOption::VALUE_NONE, 'Deprecated: same as --reset'], ['phpstorm-noinspections', 'p', InputOption::VALUE_NONE, 'Add PhpFullyQualifiedNameUsageInspection and PhpUnnecessaryFullyQualifiedNameInspection PHPStorm ' . 'noinspection tags', diff --git a/tests/Console/ModelsCommand/ResetAndSmartReset/Test.php b/tests/Console/ModelsCommand/ResetAndSmartReset/Test.php index 865684e..6ed8b80 100644 --- a/tests/Console/ModelsCommand/ResetAndSmartReset/Test.php +++ b/tests/Console/ModelsCommand/ResetAndSmartReset/Test.php @@ -35,18 +35,4 @@ class Test extends AbstractModelsCommand $this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay()); $this->assertMatchesMockedSnapshot(); } - - public function testSmartReset(): void - { - $command = $this->app->make(ModelsCommand::class); - - $tester = $this->runCommand($command, [ - '--write' => true, - '--smart-reset' => true, - ]); - - $this->assertSame(0, $tester->getStatusCode()); - $this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay()); - $this->assertMatchesMockedSnapshot(); - } }