Skip to content

Commit 524ec04

Browse files
committed
Remove --smart-reset completely
See barryvdh#1523 (comment)
1 parent 02af2a2 commit 524ec04

File tree

4 files changed

+3
-18
lines changed

4 files changed

+3
-18
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ All notable changes to this project will be documented in this file.
1111
- Support for Laravel 11 [#1520 / KentarouTakeda](https://github.com/barryvdh/laravel-ide-helper/pull/1520)
1212

1313
### Changed
14-
- 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)
14+
- 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)
1515
- Use short types (`int` and `bool` instead of `integer` and `boolean`) [#1524 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1524)
1616

1717
### Removed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ The class name will be different from the model, avoiding the IDE duplicate anno
151151
152152
Writing to the models should keep the existing comments and only append new properties/methods. It will not update changed properties/methods.
153153

154-
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.
154+
With the `--reset (-R)` option, the whole existing PHPDoc is replaced, including any comments that have been made.
155155

156156
```bash
157157
php artisan ide-helper:models "App\Models\Post"

src/Console/ModelsCommand.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function handle()
150150
);
151151
$model = $this->argument('model');
152152
$ignore = $this->option('ignore');
153-
$this->reset = $this->option('reset') || $this->option('smart-reset');
153+
$this->reset = $this->option('reset');
154154
$this->phpstorm_noinspections = $this->option('phpstorm-noinspections');
155155
$this->write_model_magic_where = $this->laravel['config']->get('ide-helper.write_model_magic_where', true);
156156
$this->write_model_external_builder_methods = $this->laravel['config']->get('ide-helper.write_model_external_builder_methods', true);
@@ -215,7 +215,6 @@ protected function getOptions()
215215
],
216216
['nowrite', 'N', InputOption::VALUE_NONE, 'Don\'t write to Model file'],
217217
['reset', 'R', InputOption::VALUE_NONE, 'Refresh the properties/methods list, but keep the text'],
218-
['smart-reset', 'r', InputOption::VALUE_NONE, 'Deprecated: same as --reset'],
219218
['phpstorm-noinspections', 'p', InputOption::VALUE_NONE,
220219
'Add PhpFullyQualifiedNameUsageInspection and PhpUnnecessaryFullyQualifiedNameInspection PHPStorm ' .
221220
'noinspection tags',

tests/Console/ModelsCommand/ResetAndSmartReset/Test.php

-14
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,4 @@ public function testReset(): void
3535
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
3636
$this->assertMatchesMockedSnapshot();
3737
}
38-
39-
public function testSmartReset(): void
40-
{
41-
$command = $this->app->make(ModelsCommand::class);
42-
43-
$tester = $this->runCommand($command, [
44-
'--write' => true,
45-
'--smart-reset' => true,
46-
]);
47-
48-
$this->assertSame(0, $tester->getStatusCode());
49-
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
50-
$this->assertMatchesMockedSnapshot();
51-
}
5238
}

0 commit comments

Comments
 (0)