Smarter reset (#1603)

* Smarter reset

* Changelog

* Fix phpdocs
This commit is contained in:
Barry vd. Heuvel
2024-10-28 12:21:53 +01:00
committed by GitHub
parent 7740b80704
commit 7549f58a30
5 changed files with 24 additions and 4 deletions
+9 -3
View File
@@ -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 = [];