Updated Rector to commit ca6dfe2e1ccdced5ac18f4a686d78e16549d9812

ca6dfe2e1c [Php80] Mirror additional docblock on importNames() on ClassPropertyAssignToConstructorPromotionRector (#2410)
This commit is contained in:
Tomas Votruba 2022-06-01 16:36:10 +00:00
parent 4d8282a2ea
commit 532e6c65bd
12 changed files with 62 additions and 49 deletions

View File

@ -12,6 +12,7 @@ use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Property;
use PhpParser\Node\UnionType;
use PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode;
use PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode;
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger;
use Rector\BetterPhpDocParser\ValueObject\PhpDocAttributeKey;
use Rector\Core\NodeAnalyzer\ParamAnalyzer;
@ -138,7 +139,7 @@ CODE_SAMPLE
$this->variableRenamer->renameVariableInFunctionLike($constructClassMethod, $oldName, $propertyName, null);
$paramTagValueNode = $classMethodPhpDocInfo->getParamTagValueNodeByName($paramName);
if (!$paramTagValueNode instanceof \PHPStan\PhpDocParser\Ast\PhpDoc\ParamTagValueNode) {
$this->decorateParamWithPropertyPhpDocInfo($property, $param);
$this->decorateParamWithPropertyPhpDocInfo($constructClassMethod, $property, $param, $paramName);
} elseif ($paramTagValueNode->parameterName !== '$' . $propertyName) {
$paramTagValueNode->parameterName = '$' . $propertyName;
$paramTagValueNode->setAttribute(\Rector\BetterPhpDocParser\ValueObject\PhpDocAttributeKey::ORIG_NODE, null);
@ -165,16 +166,23 @@ CODE_SAMPLE
$param->type = $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode($objectType, \Rector\PHPStanStaticTypeMapper\Enum\TypeKind::PARAM);
}
}
private function decorateParamWithPropertyPhpDocInfo(\PhpParser\Node\Stmt\Property $property, \PhpParser\Node\Param $param) : void
private function decorateParamWithPropertyPhpDocInfo(\PhpParser\Node\Stmt\ClassMethod $classMethod, \PhpParser\Node\Stmt\Property $property, \PhpParser\Node\Param $param, string $paramName) : void
{
$propertyPhpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($property);
$propertyPhpDocInfo->markAsChanged();
$param->setAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::PHP_DOC_INFO, $propertyPhpDocInfo);
// make sure the docblock is useful
if ($param->type === null) {
return;
$varTagValueNode = $propertyPhpDocInfo->getVarTagValueNode();
if (!$varTagValueNode instanceof \PHPStan\PhpDocParser\Ast\PhpDoc\VarTagValueNode) {
return;
}
$paramType = $this->staticTypeMapper->mapPHPStanPhpDocTypeToPHPStanType($varTagValueNode, $property);
$classMethodPhpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($classMethod);
$this->phpDocTypeChanger->changeParamType($classMethodPhpDocInfo, $paramType, $param, $paramName);
} else {
$paramType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($param->type);
}
$paramType = $this->staticTypeMapper->mapPhpParserNodePHPStanType($param->type);
$this->varTagRemover->removeVarPhpTagValueNodeIfNotComment($param, $paramType);
}
private function shouldSkipParam(\PhpParser\Node\Param $param) : bool

View File

@ -16,11 +16,11 @@ final class VersionResolver
/**
* @var string
*/
public const PACKAGE_VERSION = 'e6ebae365bf66fee2d321531c6f4e59e33efce58';
public const PACKAGE_VERSION = 'ca6dfe2e1ccdced5ac18f4a686d78e16549d9812';
/**
* @var string
*/
public const RELEASE_DATE = '2022-06-01 15:16:02';
public const RELEASE_DATE = '2022-06-01 18:30:52';
/**
* @var int
*/

2
vendor/autoload.php vendored
View File

@ -9,4 +9,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit556465aba0dafd245547eb9bc41abeff::getLoader();
return ComposerAutoloaderInita8a0aa9805d1b334f71615059ecc6766::getLoader();

View File

@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit556465aba0dafd245547eb9bc41abeff
class ComposerAutoloaderInita8a0aa9805d1b334f71615059ecc6766
{
private static $loader;
@ -22,19 +22,19 @@ class ComposerAutoloaderInit556465aba0dafd245547eb9bc41abeff
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit556465aba0dafd245547eb9bc41abeff', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInita8a0aa9805d1b334f71615059ecc6766', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit556465aba0dafd245547eb9bc41abeff', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInita8a0aa9805d1b334f71615059ecc6766', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit556465aba0dafd245547eb9bc41abeff::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInita8a0aa9805d1b334f71615059ecc6766::getInitializer($loader));
$loader->setClassMapAuthoritative(true);
$loader->register(true);
$includeFiles = \Composer\Autoload\ComposerStaticInit556465aba0dafd245547eb9bc41abeff::$files;
$includeFiles = \Composer\Autoload\ComposerStaticInita8a0aa9805d1b334f71615059ecc6766::$files;
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire556465aba0dafd245547eb9bc41abeff($fileIdentifier, $file);
composerRequirea8a0aa9805d1b334f71615059ecc6766($fileIdentifier, $file);
}
return $loader;
@ -46,7 +46,7 @@ class ComposerAutoloaderInit556465aba0dafd245547eb9bc41abeff
* @param string $file
* @return void
*/
function composerRequire556465aba0dafd245547eb9bc41abeff($fileIdentifier, $file)
function composerRequirea8a0aa9805d1b334f71615059ecc6766($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

View File

@ -4,7 +4,7 @@
namespace Composer\Autoload;
class ComposerStaticInit556465aba0dafd245547eb9bc41abeff
class ComposerStaticInita8a0aa9805d1b334f71615059ecc6766
{
public static $files = array (
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@ -3784,9 +3784,9 @@ class ComposerStaticInit556465aba0dafd245547eb9bc41abeff
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit556465aba0dafd245547eb9bc41abeff::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit556465aba0dafd245547eb9bc41abeff::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit556465aba0dafd245547eb9bc41abeff::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInita8a0aa9805d1b334f71615059ecc6766::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInita8a0aa9805d1b334f71615059ecc6766::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInita8a0aa9805d1b334f71615059ecc6766::$classMap;
}, null, ClassLoader::class);
}

View File

@ -867,17 +867,17 @@
},
{
"name": "phpstan\/phpstan",
"version": "1.7.7",
"version_normalized": "1.7.7.0",
"version": "1.7.8",
"version_normalized": "1.7.8.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/phpstan\/phpstan.git",
"reference": "cadad14ac63d8a432e01ae89ac5d0ff6fc3b16ab"
"reference": "2bf3d43015d56abac4d002a4d2d6c3a7d6fa627a"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/cadad14ac63d8a432e01ae89ac5d0ff6fc3b16ab",
"reference": "cadad14ac63d8a432e01ae89ac5d0ff6fc3b16ab",
"url": "https:\/\/api.github.com\/repos\/phpstan\/phpstan\/zipball\/2bf3d43015d56abac4d002a4d2d6c3a7d6fa627a",
"reference": "2bf3d43015d56abac4d002a4d2d6c3a7d6fa627a",
"shasum": ""
},
"require": {
@ -886,7 +886,7 @@
"conflict": {
"phpstan\/phpstan-shim": "*"
},
"time": "2022-05-31T13:58:21+00:00",
"time": "2022-06-01T13:43:17+00:00",
"bin": [
"phpstan",
"phpstan.phar"
@ -905,7 +905,7 @@
"description": "PHPStan - PHP Static Analysis Tool",
"support": {
"issues": "https:\/\/github.com\/phpstan\/phpstan\/issues",
"source": "https:\/\/github.com\/phpstan\/phpstan\/tree\/1.7.7"
"source": "https:\/\/github.com\/phpstan\/phpstan\/tree\/1.7.8"
},
"funding": [
{
@ -2554,12 +2554,12 @@
"source": {
"type": "git",
"url": "https:\/\/github.com\/sabbelasichon\/typo3-rector.git",
"reference": "0b74993e3b2ca453315904128a418b82ae61d46b"
"reference": "a05d4ca73772374603dcccc01705eee456ff61af"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/sabbelasichon\/typo3-rector\/zipball\/0b74993e3b2ca453315904128a418b82ae61d46b",
"reference": "0b74993e3b2ca453315904128a418b82ae61d46b",
"url": "https:\/\/api.github.com\/repos\/sabbelasichon\/typo3-rector\/zipball\/a05d4ca73772374603dcccc01705eee456ff61af",
"reference": "a05d4ca73772374603dcccc01705eee456ff61af",
"shasum": ""
},
"require": {
@ -2589,7 +2589,7 @@
"symplify\/vendor-patches": "^10.2",
"tracy\/tracy": "^2.8"
},
"time": "2022-05-31T22:05:36+00:00",
"time": "2022-06-01T16:27:51+00:00",
"default-branch": true,
"type": "rector-extension",
"extra": {

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -1,16 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE0yaA1ZV9xxFr4pwUzxoQjQ565yAFAmKWHvMACgkQzxoQjQ56
5yB55Q//f52ANNadoq4cvMi1ZVtsRyiW0i0ZT/wev2VGHDPRZ+QH9sCubNAqr+QE
9oiLLZ/DAHScyNNB1gErdasCvS8YCnfb8MxFRfd1hkjM1GPMj4bpn6fenJTuotsp
D3Fz4nYIJyZdhJhM/MqmFbNMWn21VQd+xBWtn8nbZF/c8IyoZ+udwjxRs6+ggcnH
oBEDrgDVi4DzIDVLPbYcEaKBODoOCOe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iwsxswhffB4eXYYV6ca2mndL3bTkSieNXJvGawHtMv18NoeMpgyoLpF3T
lTv9uErcIfCFB/yJjXp+B348oMFX/ruxrC6aZ653qowQ6s/sSpPQh7wfB1qaCTnT
SIoGmIHASLN9c8t7GGrUX7FjUFOZX1Qpiv4t/cNyx41fXlFrVoQ=
=dNi2
-----END PGP SIGNATURE-----

View File

@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
*/
final class GeneratedConfig
{
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 7e0a6f9'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main c745427'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 784271e'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main e1d324e'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main b4026b1'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 86b0213'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 31de140'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 6ad431c'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 0b74993'));
public const EXTENSIONS = array('rector/rector-cakephp' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-cakephp', 'relative_install_path' => '../../rector-cakephp', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 7e0a6f9'), 'rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main c745427'), 'rector/rector-generator' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-generator', 'relative_install_path' => '../../rector-generator', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 784271e'), 'rector/rector-laravel' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-laravel', 'relative_install_path' => '../../rector-laravel', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main e1d324e'), 'rector/rector-nette' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-nette', 'relative_install_path' => '../../rector-nette', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main b4026b1'), 'rector/rector-phpoffice' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpoffice', 'relative_install_path' => '../../rector-phpoffice', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 86b0213'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 31de140'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main 6ad431c'), 'ssch/typo3-rector' => array('install_path' => '/home/runner/work/rector-src/rector-src/vendor/ssch/typo3-rector', 'relative_install_path' => '../../../ssch/typo3-rector', 'extra' => array('includes' => array(0 => 'config/config.php')), 'version' => 'dev-main a05d4ca'));
private function __construct()
{
}

View File

@ -9,8 +9,8 @@ $loader = require_once __DIR__.'/autoload.php';
if (!class_exists('AutoloadIncluder', false) && !interface_exists('AutoloadIncluder', false) && !trait_exists('AutoloadIncluder', false)) {
spl_autoload_call('RectorPrefix20220601\AutoloadIncluder');
}
if (!class_exists('ComposerAutoloaderInit556465aba0dafd245547eb9bc41abeff', false) && !interface_exists('ComposerAutoloaderInit556465aba0dafd245547eb9bc41abeff', false) && !trait_exists('ComposerAutoloaderInit556465aba0dafd245547eb9bc41abeff', false)) {
spl_autoload_call('RectorPrefix20220601\ComposerAutoloaderInit556465aba0dafd245547eb9bc41abeff');
if (!class_exists('ComposerAutoloaderInita8a0aa9805d1b334f71615059ecc6766', false) && !interface_exists('ComposerAutoloaderInita8a0aa9805d1b334f71615059ecc6766', false) && !trait_exists('ComposerAutoloaderInita8a0aa9805d1b334f71615059ecc6766', false)) {
spl_autoload_call('RectorPrefix20220601\ComposerAutoloaderInita8a0aa9805d1b334f71615059ecc6766');
}
if (!class_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !interface_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false) && !trait_exists('Helmich\TypoScriptParser\Parser\AST\Statement', false)) {
spl_autoload_call('RectorPrefix20220601\Helmich\TypoScriptParser\Parser\AST\Statement');
@ -59,9 +59,9 @@ if (!function_exists('print_node')) {
return \RectorPrefix20220601\print_node(...func_get_args());
}
}
if (!function_exists('composerRequire556465aba0dafd245547eb9bc41abeff')) {
function composerRequire556465aba0dafd245547eb9bc41abeff() {
return \RectorPrefix20220601\composerRequire556465aba0dafd245547eb9bc41abeff(...func_get_args());
if (!function_exists('composerRequirea8a0aa9805d1b334f71615059ecc6766')) {
function composerRequirea8a0aa9805d1b334f71615059ecc6766() {
return \RectorPrefix20220601\composerRequirea8a0aa9805d1b334f71615059ecc6766(...func_get_args());
}
}
if (!function_exists('scanPath')) {

View File

@ -80,6 +80,11 @@
"@fix-rector",
"@fix-style"
],
"contribute": [
"@fix-rector",
"@fix-style",
"@analyze"
],
"check-style": "@php vendor\/bin\/ecs check --ansi",
"fix-style": "@php vendor\/bin\/ecs check --fix --ansi",
"analyze": "@php vendor\/bin\/phpstan analyse --memory-limit=-1 --ansi --error-format symplify",