Updated Rector to commit 827992ae9784abb4a2a5f5f3aecbe52606f3c737

827992ae97 [Performance] [DeadCode] Early check no params in __construct() on RemoveUnusedPromotedPropertyRector (#5672)
This commit is contained in:
Tomas Votruba 2024-02-29 13:34:04 +00:00
parent df81c907da
commit 39c0390278
4 changed files with 16 additions and 11 deletions

View File

@ -1802,12 +1802,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git",
"reference": "1de46189c807347a5c57e74a3e2a7f12ed60782e"
"reference": "c5e8280568d24e618ca2bb30eabc487c536afcda"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/1de46189c807347a5c57e74a3e2a7f12ed60782e",
"reference": "1de46189c807347a5c57e74a3e2a7f12ed60782e",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/c5e8280568d24e618ca2bb30eabc487c536afcda",
"reference": "c5e8280568d24e618ca2bb30eabc487c536afcda",
"shasum": ""
},
"require": {
@ -1830,7 +1830,7 @@
"tomasvotruba\/class-leak": "^0.2",
"tracy\/tracy": "^2.10"
},
"time": "2024-02-27T10:47:52+00:00",
"time": "2024-02-29T13:16:28+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main a9f411d'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 68e0635'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 1de4618'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 7aeda0b'));
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main a9f411d'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 68e0635'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main c5e8280'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 7aeda0b'));
private function __construct()
{
}

View File

@ -118,11 +118,13 @@ CODE_SAMPLE
}
$this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($node);
$node->attrGroups = \array_merge($node->attrGroups, $coversAttributeGroups);
return $node;
}
if ($node instanceof ClassMethod) {
$this->removeMethodCoversAnnotations($node);
$this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($node);
$hasChanged = $this->removeMethodCoversAnnotations($node);
if ($hasChanged === \false) {
return null;
}
$this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($node);
return $node;
}
private function createAttributeGroup(string $annotationValue) : AttributeGroup
@ -219,19 +221,22 @@ CODE_SAMPLE
}
return $attributeGroups;
}
private function removeMethodCoversAnnotations(ClassMethod $classMethod) : void
private function removeMethodCoversAnnotations(ClassMethod $classMethod) : bool
{
$phpDocInfo = $this->phpDocInfoFactory->createFromNode($classMethod);
if (!$phpDocInfo instanceof PhpDocInfo) {
return;
return \false;
}
$hasChanged = \false;
$desiredTagValueNodes = $phpDocInfo->getTagsByName('covers');
foreach ($desiredTagValueNodes as $desiredTagValueNode) {
if (!$desiredTagValueNode->value instanceof GenericTagValueNode) {
continue;
}
$this->phpDocTagRemover->removeTagValueFromNode($phpDocInfo, $desiredTagValueNode);
$hasChanged = \true;
}
return $hasChanged;
}
private function getClass(string $classWithMethod) : string
{