Skip to content

Commit

Permalink
Remove --smart-reset completely
Browse files Browse the repository at this point in the history
  • Loading branch information
mfn committed Feb 19, 2024
1 parent 02af2a2 commit 6d653fe
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 skipp 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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions src/Console/ModelsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function handle()
);
$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);
Expand Down Expand Up @@ -215,7 +215,6 @@ protected function getOptions()
],
['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',
Expand Down
14 changes: 0 additions & 14 deletions tests/Console/ModelsCommand/ResetAndSmartReset/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,4 @@ public function testReset(): void
$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();
}
}

0 comments on commit 6d653fe

Please sign in to comment.