Skip to content

Commit

Permalink
Updated Rector to commit d180b8d7363f508a4e9c6931c327c65aed5ff6ee
Browse files Browse the repository at this point in the history
rectorphp/rector-src@d180b8d [CodeQuality] Skip no @Property doc on DynamicDocBlockPropertyToNativePropertyRector (#6380)
  • Loading branch information
TomasVotruba committed Oct 12, 2024
1 parent 8388edb commit 254c38f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,23 +122,27 @@ public function refactor(Node $node) : ?Node
if ($this->shouldSkipClass($node)) {
return null;
}
// 1. remove dynamic attribute, most likely any
$node->attrGroups = [];
// 2. add defined @property explicitly
$classPhpDocInfo = $this->phpDocInfoFactory->createFromNode($node);
if ($classPhpDocInfo instanceof PhpDocInfo) {
$propertyPhpDocTagNodes = $classPhpDocInfo->getTagsByName('property');
$newProperties = $this->createNewPropertyFromPropertyTagValueNodes($propertyPhpDocTagNodes, $node);
// remove property tags
foreach ($propertyPhpDocTagNodes as $propertyPhpDocTagNode) {
// remove from docblock
$this->phpDocTagRemover->removeTagValueFromNode($classPhpDocInfo, $propertyPhpDocTagNode);
}
// merge new properties to start of the file
$node->stmts = \array_merge($newProperties, $node->stmts);
// update doc info
$this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($node);
if (!$classPhpDocInfo instanceof PhpDocInfo) {
return null;
}
$propertyPhpDocTagNodes = $classPhpDocInfo->getTagsByName('property');
if ($propertyPhpDocTagNodes === []) {
return null;
}
// 1. remove dynamic attribute, most likely any
$node->attrGroups = [];
$newProperties = $this->createNewPropertyFromPropertyTagValueNodes($propertyPhpDocTagNodes, $node);
// remove property tags
foreach ($propertyPhpDocTagNodes as $propertyPhpDocTagNode) {
// remove from docblock
$this->phpDocTagRemover->removeTagValueFromNode($classPhpDocInfo, $propertyPhpDocTagNode);
}
// merge new properties to start of the file
$node->stmts = \array_merge($newProperties, $node->stmts);
// update doc info
$this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($node);
return $node;
}
public function provideMinPhpVersion() : int
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '684f23d165407e0461a48d2c1fd289834a492876';
public const PACKAGE_VERSION = 'd180b8d7363f508a4e9c6931c327c65aed5ff6ee';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-10-12 17:53:31';
public const RELEASE_DATE = '2024-10-12 23:13:40';
/**
* @var int
*/
Expand Down

0 comments on commit 254c38f

Please sign in to comment.