Skip to content

Commit

Permalink
Updated Rector to commit 8bce42424e3418ee287fe34b1004b1f66449b923
Browse files Browse the repository at this point in the history
rectorphp/rector-src@8bce424 [NodeTypeResolver] Move UnionType doc vs FullyQualified native type as not equal to TypeComparator (#5793)
  • Loading branch information
TomasVotruba committed Apr 3, 2024
1 parent 3fdaba9 commit 36ab30b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
5 changes: 0 additions & 5 deletions rules/DeadCode/PhpDoc/DeadParamTagValueNodeAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
declare (strict_types=1);
namespace Rector\DeadCode\PhpDoc;

use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode;
use PhpParser\Node\FunctionLike;
use PhpParser\Node\Name;
use PhpParser\Node\Name\FullyQualified;
use PhpParser\Node\Param;
use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode;
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
Expand Down Expand Up @@ -70,9 +68,6 @@ public function isDead(ParamTagValueNode $paramTagValueNode, FunctionLike $funct
if ($paramTagValueNode->description !== '') {
return \false;
}
if ($paramTagValueNode->type instanceof UnionTypeNode && $param->type instanceof FullyQualified) {
return \false;
}
if ($param->type instanceof Name && $this->nodeNameResolver->isName($param->type, 'object')) {
return $paramTagValueNode->type instanceof IdentifierTypeNode && (string) $paramTagValueNode->type === 'object';
}
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 = '52aa64ffe2cc0add4cbffede6ce36cbec576ef2f';
public const PACKAGE_VERSION = '8bce42424e3418ee287fe34b1004b1f66449b923';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-04-03 13:19:32';
public const RELEASE_DATE = '2024-04-03 06:34:12';
/**
* @var int
*/
Expand Down
5 changes: 5 additions & 0 deletions src/NodeTypeResolver/TypeComparator/TypeComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
declare (strict_types=1);
namespace Rector\NodeTypeResolver\TypeComparator;

use PHPStan\PhpDocParser\Ast\Type\UnionTypeNode;
use PhpParser\Node;
use PhpParser\Node\Name\FullyQualified;
use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode;
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
use PHPStan\Reflection\ClassReflection;
Expand Down Expand Up @@ -102,6 +104,9 @@ public function areTypesEqual(Type $firstType, Type $secondType) : 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);
$phpStanDocType = $this->staticTypeMapper->mapPHPStanPhpDocTypeNodeToPHPStanType($phpStanDocTypeNode, $node);
if (!$this->areTypesEqual($phpParserNodeType, $phpStanDocType) && $this->isSubtype($phpStanDocType, $phpParserNodeType)) {
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -1742,12 +1742,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/rectorphp\/rector-downgrade-php.git",
"reference": "1fc03517141811339be88a19bc4d2bd860c02a79"
"reference": "05e44cfe25504ac9de978b9b977caf207ed0c9e1"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/1fc03517141811339be88a19bc4d2bd860c02a79",
"reference": "1fc03517141811339be88a19bc4d2bd860c02a79",
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-downgrade-php\/zipball\/05e44cfe25504ac9de978b9b977caf207ed0c9e1",
"reference": "05e44cfe25504ac9de978b9b977caf207ed0c9e1",
"shasum": ""
},
"require": {
Expand All @@ -1760,7 +1760,7 @@
"phpunit\/phpunit": "^10.3",
"rector\/phpstan-rules": "^0.7.4",
"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\/phpstan-extensions": "^11.3",
"symplify\/phpstan-rules": "^12.4",
Expand All @@ -1769,7 +1769,7 @@
"tomasvotruba\/class-leak": "^0.2",
"tracy\/tracy": "^2.10"
},
"time": "2024-04-03T06:16:44+00:00",
"time": "2024-04-03T06:20:55+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/installed.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion vendor/rector/extension-installer/src/GeneratedConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
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()
{
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/rector/rector-downgrade-php/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"phpunit\/phpunit": "^10.3",
"rector\/phpstan-rules": "^0.7.4",
"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\/phpstan-extensions": "^11.3",
"symplify\/phpstan-rules": "^12.4",
Expand Down

0 comments on commit 36ab30b

Please sign in to comment.