mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 10:07:12 +00:00
Compare commits
3
Commits
feat-docblocks
...
v3.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bc1d67f01c | ||
|
|
8eab699835 | ||
|
|
49ac75d805 |
+9
-2
@@ -2,16 +2,23 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
[Next release](https://github.com/barryvdh/laravel-ide-helper/compare/v2.15.0...master)
|
[Next release](https://github.com/barryvdh/laravel-ide-helper/compare/v3.0.0...master)
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
2024-03-01, 3.0.0
|
||||||
|
------------------
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- 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"
|
||||||
|
|||||||
+7
-14
@@ -1,24 +1,17 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<phpunit
|
||||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
bootstrap="vendor/autoload.php"
|
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
|
||||||
backupGlobals="false"
|
cacheDirectory=".phpunit.result.cache"
|
||||||
backupStaticAttributes="false"
|
>
|
||||||
colors="true"
|
|
||||||
verbose="true"
|
|
||||||
convertErrorsToExceptions="true"
|
|
||||||
convertNoticesToExceptions="true"
|
|
||||||
convertWarningsToExceptions="true"
|
|
||||||
processIsolation="false"
|
|
||||||
stopOnFailure="false">
|
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Unit Tests">
|
<testsuite name="Unit Tests">
|
||||||
<directory>tests</directory>
|
<directory>tests</directory>
|
||||||
</testsuite>
|
</testsuite>
|
||||||
</testsuites>
|
</testsuites>
|
||||||
<coverage>
|
<source>
|
||||||
<include>
|
<include>
|
||||||
<directory suffix=".php">src/</directory>
|
<directory suffix=".php">src/</directory>
|
||||||
</include>
|
</include>
|
||||||
</coverage>
|
</source>
|
||||||
</phpunit>
|
</phpunit>
|
||||||
|
|||||||
@@ -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