mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
Smarter reset
This commit is contained in:
@@ -945,13 +945,19 @@ class ModelsCommand extends Command
|
||||
$reflection->getParentClass()->getInterfaceNames()
|
||||
);
|
||||
|
||||
$phpdoc = new DocBlock($reflection, new Context($namespace));
|
||||
if ($this->reset) {
|
||||
$phpdoc = new DocBlock('', new Context($namespace));
|
||||
$phpdoc->setText(
|
||||
(new DocBlock($reflection, new Context($namespace)))->getText()
|
||||
);
|
||||
} else {
|
||||
$phpdoc = new DocBlock($reflection, new Context($namespace));
|
||||
foreach ($phpdoc->getTags() as $tag) {
|
||||
if (
|
||||
in_array($tag->getName(), ['property', 'property-read', 'property-write', 'method', 'mixin'])
|
||||
|| ($tag->getName() === 'noinspection' && in_array($tag->getContent(), ['PhpUnnecessaryFullyQualifiedNameInspection', 'PhpFullyQualifiedNameUsageInspection']))
|
||||
) {
|
||||
$phpdoc->deleteTag($tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$properties = [];
|
||||
|
||||
@@ -9,7 +9,11 @@ use Illuminate\Database\Eloquent\Model;
|
||||
/**
|
||||
* Text of existing phpdoc
|
||||
*
|
||||
* @implements \ArrayAccess
|
||||
* @noinspection PhpUnreachableStatementInspection
|
||||
* @PhpFullyQualifiedNameUsageInspection PhpUnnecessaryFullyQualifiedNameInspection
|
||||
* @property string $foo
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class Simple extends Model
|
||||
{
|
||||
|
||||
@@ -9,6 +9,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||
/**
|
||||
* Text of existing phpdoc
|
||||
*
|
||||
* @implements \ArrayAccess
|
||||
* @noinspection PhpUnreachableStatementInspection
|
||||
* @PhpFullyQualifiedNameUsageInspection PhpUnnecessaryFullyQualifiedNameInspection
|
||||
* @property string $foo
|
||||
* @property int $id
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newModelQuery()
|
||||
|
||||
@@ -9,6 +9,9 @@ use Illuminate\Database\Eloquent\Model;
|
||||
/**
|
||||
* Text of existing phpdoc
|
||||
*
|
||||
* @implements \ArrayAccess
|
||||
* @noinspection PhpUnreachableStatementInspection
|
||||
* @PhpFullyQualifiedNameUsageInspection PhpUnnecessaryFullyQualifiedNameInspection
|
||||
* @property int $id
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newQuery()
|
||||
|
||||
Reference in New Issue
Block a user