Updated Rector to commit 8bce42424e3418ee287fe34b1004b1f66449b923

8bce42424e [NodeTypeResolver] Move UnionType doc vs FullyQualified native type as not equal to TypeComparator (#5793)
This commit is contained in:
Tomas Votruba 2024-04-03 06:36:42 +00:00
parent 3fdaba944f
commit 36ab30b476
7 changed files with 15 additions and 15 deletions

View File

@ -3,10 +3,8 @@
declare (strict_types=1); declare (strict_types=1);
namespace Rector\DeadCode\PhpDoc; namespace Rector\DeadCode\PhpDoc;
use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode;
use PhpParser\Node\FunctionLike; use PhpParser\Node\FunctionLike;
use PhpParser\Node\Name; use PhpParser\Node\Name;
use PhpParser\Node\Name\FullyQualified;
use PhpParser\Node\Param; use PhpParser\Node\Param;
use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode; use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode;
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode; use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
@ -70,9 +68,6 @@ final class DeadParamTagValueNodeAnalyzer
if ($paramTagValueNode->description !== '') { if ($paramTagValueNode->description !== '') {
return \false; return \false;
} }
if ($paramTagValueNode->type instanceof UnionTypeNode && $param->type instanceof FullyQualified) {
return \false;
}
if ($param->type instanceof Name && $this->nodeNameResolver->isName($param->type, 'object')) { if ($param->type instanceof Name && $this->nodeNameResolver->isName($param->type, 'object')) {
return $paramTagValueNode->type instanceof IdentifierTypeNode && (string) $paramTagValueNode->type === 'object'; return $paramTagValueNode->type instanceof IdentifierTypeNode && (string) $paramTagValueNode->type === 'object';
} }

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api * @api
* @var string * @var string
*/ */
public const PACKAGE_VERSION = '52aa64ffe2cc0add4cbffede6ce36cbec576ef2f'; public const PACKAGE_VERSION = '8bce42424e3418ee287fe34b1004b1f66449b923';
/** /**
* @api * @api
* @var string * @var string
*/ */
public const RELEASE_DATE = '2024-04-03 13:19:32'; public const RELEASE_DATE = '2024-04-03 06:34:12';
/** /**
* @var int * @var int
*/ */

View File

@ -3,7 +3,9 @@
declare (strict_types=1); declare (strict_types=1);
namespace Rector\NodeTypeResolver\TypeComparator; namespace Rector\NodeTypeResolver\TypeComparator;
use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode;
use PhpParser\Node; use PhpParser\Node;
use PhpParser\Node\Name\FullyQualified;
use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode; use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode;
use PHPStan\PhpDocParser\Ast\Type\TypeNode; use PHPStan\PhpDocParser\Ast\Type\TypeNode;
use PHPStan\Reflection\ClassReflection; use PHPStan\Reflection\ClassReflection;
@ -102,6 +104,9 @@ final class TypeComparator
} }
public function arePhpParserAndPhpStanPhpDocTypesEqual(Node $phpParserNode, TypeNode $phpStanDocTypeNode, Node $node) : bool public function arePhpParserAndPhpStanPhpDocTypesEqual(Node $phpParserNode, TypeNode $phpStanDocTypeNode, Node $node) : bool
{ {
if ($phpStanDocTypeNode instanceof UnionTypeNode && $phpParserNode instanceof FullyQualified) {
return \false;
}
$phpParserNodeType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($phpParserNode); $phpParserNodeType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($phpParserNode);
$phpStanDocType = $this->staticTypeMapper->mapPHPStanPhpDocTypeNodeToPHPStanType($phpStanDocTypeNode, $node); $phpStanDocType = $this->staticTypeMapper->mapPHPStanPhpDocTypeNodeToPHPStanType($phpStanDocTypeNode, $node);
if (!$this->areTypesEqual($phpParserNodeType, $phpStanDocType) && $this->isSubtype($phpStanDocType, $phpParserNodeType)) { if (!$this->areTypesEqual($phpParserNodeType, $phpStanDocType) && $this->isSubtype($phpStanDocType, $phpParserNodeType)) {

View File

@ -1742,12 +1742,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git", "url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
"reference": "1fc03517141811339be88a19bc4d2bd860c02a79" "reference": "05e44cfe25504ac9de978b9b977caf207ed0c9e1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/1fc03517141811339be88a19bc4d2bd860c02a79", "url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/05e44cfe25504ac9de978b9b977caf207ed0c9e1",
"reference": "1fc03517141811339be88a19bc4d2bd860c02a79", "reference": "05e44cfe25504ac9de978b9b977caf207ed0c9e1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1760,7 +1760,7 @@
"phpunit\/phpunit": "^10.3", "phpunit\/phpunit": "^10.3",
"rector\/phpstan-rules": "^0.7.4", "rector\/phpstan-rules": "^0.7.4",
"rector\/rector-generator": "^0.7.3", "rector\/rector-generator": "^0.7.3",
"rector\/rector-src": "dev-clean-up-type-hasher", "rector\/rector-src": "dev-main",
"symplify\/easy-coding-standard": "^12.0", "symplify\/easy-coding-standard": "^12.0",
"symplify\/phpstan-extensions": "^11.3", "symplify\/phpstan-extensions": "^11.3",
"symplify\/phpstan-rules": "^12.4", "symplify\/phpstan-rules": "^12.4",
@ -1769,7 +1769,7 @@
"tomasvotruba\/class-leak": "^0.2", "tomasvotruba\/class-leak": "^0.2",
"tracy\/tracy": "^2.10" "tracy\/tracy": "^2.10"
}, },
"time": "2024-04-03T06:16:44+00:00", "time": "2024-04-03T06:20:55+00:00",
"default-branch": true, "default-branch": true,
"type": "rector-extension", "type": "rector-extension",
"extra": { "extra": {

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/ */
final class GeneratedConfig 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 b3da143'), '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 1fc0351'), '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 6845db4'), '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 c8b6413')); 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 b3da143'), '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 05e44cf'), '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 6845db4'), '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 c8b6413'));
private function __construct() private function __construct()
{ {
} }

View File

@ -13,7 +13,7 @@
"phpunit\/phpunit": "^10.3", "phpunit\/phpunit": "^10.3",
"rector\/phpstan-rules": "^0.7.4", "rector\/phpstan-rules": "^0.7.4",
"rector\/rector-generator": "^0.7.3", "rector\/rector-generator": "^0.7.3",
"rector\/rector-src": "dev-clean-up-type-hasher", "rector\/rector-src": "dev-main",
"symplify\/easy-coding-standard": "^12.0", "symplify\/easy-coding-standard": "^12.0",
"symplify\/phpstan-extensions": "^11.3", "symplify\/phpstan-extensions": "^11.3",
"symplify\/phpstan-rules": "^12.4", "symplify\/phpstan-rules": "^12.4",