From 5457aea4e0ae2ca43ac60b499d2149747a4314f1 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 4 Jan 2024 15:49:28 +0000 Subject: [PATCH] Updated Rector to commit 1f9829d2a3820f39fe0601b996c5cba71ffb42b0 https://github.com/rectorphp/rector-src/commit/1f9829d2a3820f39fe0601b996c5cba71ffb42b0 [Strict] Add StaticProperty supporton may be unitialized static property on DisallowedEmptyRuleFixerRector (#5428) --- rules/Strict/NodeAnalyzer/UnitializedPropertyAnalyzer.php | 5 +++-- src/Application/VersionResolver.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/rules/Strict/NodeAnalyzer/UnitializedPropertyAnalyzer.php b/rules/Strict/NodeAnalyzer/UnitializedPropertyAnalyzer.php index 9a45d434ad3..a4de880dbf7 100644 --- a/rules/Strict/NodeAnalyzer/UnitializedPropertyAnalyzer.php +++ b/rules/Strict/NodeAnalyzer/UnitializedPropertyAnalyzer.php @@ -5,6 +5,7 @@ namespace Rector\Strict\NodeAnalyzer; use PhpParser\Node\Expr; use PhpParser\Node\Expr\PropertyFetch; +use PhpParser\Node\Expr\StaticPropertyFetch; use PhpParser\Node\Stmt\ClassLike; use PhpParser\Node\Stmt\Property; use PHPStan\Type\ThisType; @@ -44,10 +45,10 @@ final class UnitializedPropertyAnalyzer } public function isUnitialized(Expr $expr) : bool { - if (!$expr instanceof PropertyFetch) { + if (!$expr instanceof PropertyFetch && !$expr instanceof StaticPropertyFetch) { return \false; } - $varType = $this->nodeTypeResolver->getType($expr->var); + $varType = $expr instanceof PropertyFetch ? $this->nodeTypeResolver->getType($expr->var) : $this->nodeTypeResolver->getType($expr->class); if ($varType instanceof ThisType) { $varType = $varType->getStaticObjectType(); } diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index d06d8bb4e18..b94578b6e37 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 = 'f85e8c27b3932196d882c70b063f517a48b5aaac'; + public const PACKAGE_VERSION = '1f9829d2a3820f39fe0601b996c5cba71ffb42b0'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-01-03 14:06:43'; + public const RELEASE_DATE = '2024-01-04 22:47:15'; /** * @var int */