Remove --smart-reset completely (#1525)

* Remove `--smart-reset` completely

See https://github.com/barryvdh/laravel-ide-helper/pull/1523#issuecomment-1952313183

* Update CHANGELOG.md

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
This commit is contained in:
Markus Podar
2024-02-19 14:03:16 +01:00
committed by GitHub
co-authored by Barry vd. Heuvel
parent 02af2a278a
commit 49ac75d805
4 changed files with 3 additions and 18 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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"
+1 -2
View File
@@ -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',
@@ -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();
}
}