From 9dda9c3cc26c6ab8e4a844abe1413066d187fa99 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sun, 29 Jan 2023 12:28:42 +0000 Subject: [PATCH] Updated Rector to commit 3450bed50204db27ca622d2056a82580a59914fb https://github.com/rectorphp/rector-src/commit/3450bed50204db27ca622d2056a82580a59914fb [TypeDeclaration] Skip used by trait on PropertyTypeFromStrictSetterGetterRector (#3319) --- .../PropertyTypeFromStrictSetterGetterRector.php | 12 +++++++++++- src/Application/VersionResolver.php | 4 ++-- vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +++++----- vendor/composer/autoload_static.php | 8 ++++---- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/rules/TypeDeclaration/Rector/Class_/PropertyTypeFromStrictSetterGetterRector.php b/rules/TypeDeclaration/Rector/Class_/PropertyTypeFromStrictSetterGetterRector.php index e61e874218b..a0097e20fda 100644 --- a/rules/TypeDeclaration/Rector/Class_/PropertyTypeFromStrictSetterGetterRector.php +++ b/rules/TypeDeclaration/Rector/Class_/PropertyTypeFromStrictSetterGetterRector.php @@ -9,6 +9,7 @@ use PhpParser\Node\Stmt\Property; use PHPStan\Type\Type; use Rector\Core\Rector\AbstractRector; use Rector\Core\ValueObject\PhpVersionFeature; +use Rector\Php74\Guard\MakePropertyTypedGuard; use Rector\PHPStanStaticTypeMapper\Enum\TypeKind; use Rector\TypeDeclaration\TypeInferer\PropertyTypeInferer\GetterTypeDeclarationPropertyTypeInferer; use Rector\TypeDeclaration\TypeInferer\PropertyTypeInferer\SetterTypeDeclarationPropertyTypeInferer; @@ -30,10 +31,16 @@ final class PropertyTypeFromStrictSetterGetterRector extends AbstractRector impl * @var \Rector\TypeDeclaration\TypeInferer\PropertyTypeInferer\SetterTypeDeclarationPropertyTypeInferer */ private $setterTypeDeclarationPropertyTypeInferer; - public function __construct(GetterTypeDeclarationPropertyTypeInferer $getterTypeDeclarationPropertyTypeInferer, SetterTypeDeclarationPropertyTypeInferer $setterTypeDeclarationPropertyTypeInferer) + /** + * @readonly + * @var \Rector\Php74\Guard\MakePropertyTypedGuard + */ + private $makePropertyTypedGuard; + public function __construct(GetterTypeDeclarationPropertyTypeInferer $getterTypeDeclarationPropertyTypeInferer, SetterTypeDeclarationPropertyTypeInferer $setterTypeDeclarationPropertyTypeInferer, MakePropertyTypedGuard $makePropertyTypedGuard) { $this->getterTypeDeclarationPropertyTypeInferer = $getterTypeDeclarationPropertyTypeInferer; $this->setterTypeDeclarationPropertyTypeInferer = $setterTypeDeclarationPropertyTypeInferer; + $this->makePropertyTypedGuard = $makePropertyTypedGuard; } public function getRuleDefinition() : RuleDefinition { @@ -98,6 +105,9 @@ CODE_SAMPLE if (!$this->isDefaultExprTypeCompatible($property, $getterSetterPropertyType)) { continue; } + if (!$this->makePropertyTypedGuard->isLegal($property, \false)) { + continue; + } $propertyTypeDclaration = $this->staticTypeMapper->mapPHPStanTypeToPhpParserNode($getterSetterPropertyType, TypeKind::PROPERTY); if (!$propertyTypeDclaration instanceof Node) { continue; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 298aa1d270b..51c6c413338 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = 'b98de3edc21312c2e5483b6a120ccb04642f5346'; + public const PACKAGE_VERSION = '3450bed50204db27ca622d2056a82580a59914fb'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-01-29 09:48:08'; + public const RELEASE_DATE = '2023-01-29 12:24:32'; /** * @var int */ diff --git a/vendor/autoload.php b/vendor/autoload.php index bbe786bd8e6..79d22603e14 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit8a543a3b9236ca4cd183a82b04f2636b::getLoader(); +return ComposerAutoloaderInit237f60ed8c00a6a6ce0e2d6d91af6957::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index b40741b1a8d..70522354a9b 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit8a543a3b9236ca4cd183a82b04f2636b +class ComposerAutoloaderInit237f60ed8c00a6a6ce0e2d6d91af6957 { private static $loader; @@ -22,17 +22,17 @@ class ComposerAutoloaderInit8a543a3b9236ca4cd183a82b04f2636b return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit8a543a3b9236ca4cd183a82b04f2636b', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit237f60ed8c00a6a6ce0e2d6d91af6957', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit8a543a3b9236ca4cd183a82b04f2636b', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit237f60ed8c00a6a6ce0e2d6d91af6957', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit8a543a3b9236ca4cd183a82b04f2636b::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit237f60ed8c00a6a6ce0e2d6d91af6957::getInitializer($loader)); $loader->setClassMapAuthoritative(true); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit8a543a3b9236ca4cd183a82b04f2636b::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit237f60ed8c00a6a6ce0e2d6d91af6957::$files; $requireFile = static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index a10d839f26a..a42225173bd 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit8a543a3b9236ca4cd183a82b04f2636b +class ComposerStaticInit237f60ed8c00a6a6ce0e2d6d91af6957 { public static $files = array ( 'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php', @@ -3080,9 +3080,9 @@ class ComposerStaticInit8a543a3b9236ca4cd183a82b04f2636b public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit8a543a3b9236ca4cd183a82b04f2636b::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit8a543a3b9236ca4cd183a82b04f2636b::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit8a543a3b9236ca4cd183a82b04f2636b::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit237f60ed8c00a6a6ce0e2d6d91af6957::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit237f60ed8c00a6a6ce0e2d6d91af6957::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit237f60ed8c00a6a6ce0e2d6d91af6957::$classMap; }, null, ClassLoader::class); }