mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-17 17:47:13 +00:00
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:
co-authored by
Barry vd. Heuvel
parent
02af2a278a
commit
49ac75d805
+1
-1
@@ -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)
|
- Support for Laravel 11 [#1520 / KentarouTakeda](https://github.com/barryvdh/laravel-ide-helper/pull/1520)
|
||||||
|
|
||||||
### Changed
|
### 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)
|
- Use short types (`int` and `bool` instead of `integer` and `boolean`) [#1524 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1524)
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|||||||
@@ -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.
|
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
|
```bash
|
||||||
php artisan ide-helper:models "App\Models\Post"
|
php artisan ide-helper:models "App\Models\Post"
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ class ModelsCommand extends Command
|
|||||||
);
|
);
|
||||||
$model = $this->argument('model');
|
$model = $this->argument('model');
|
||||||
$ignore = $this->option('ignore');
|
$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->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_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);
|
$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'],
|
['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'],
|
['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,
|
['phpstorm-noinspections', 'p', InputOption::VALUE_NONE,
|
||||||
'Add PhpFullyQualifiedNameUsageInspection and PhpUnnecessaryFullyQualifiedNameInspection PHPStorm ' .
|
'Add PhpFullyQualifiedNameUsageInspection and PhpUnnecessaryFullyQualifiedNameInspection PHPStorm ' .
|
||||||
'noinspection tags',
|
'noinspection tags',
|
||||||
|
|||||||
@@ -35,18 +35,4 @@ class Test extends AbstractModelsCommand
|
|||||||
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
|
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
|
||||||
$this->assertMatchesMockedSnapshot();
|
$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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user