From 5c2f93e7b73241a15c8620505ed043bc67c6ed71 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sun, 10 Dec 2023 02:05:30 +0000 Subject: [PATCH] Updated Rector to commit f7b9dd9035931da5a040f5c714c79c32c424b677 https://github.com/rectorphp/rector-src/commit/f7b9dd9035931da5a040f5c714c79c32c424b677 Update rector.php of skip() to allow file name has word: "Expected" (#5347) --- rules/Naming/Naming/ExpectedNameResolver.php | 14 +++++++------- src/Application/VersionResolver.php | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/rules/Naming/Naming/ExpectedNameResolver.php b/rules/Naming/Naming/ExpectedNameResolver.php index 2260db56570..bdd0076b639 100644 --- a/rules/Naming/Naming/ExpectedNameResolver.php +++ b/rules/Naming/Naming/ExpectedNameResolver.php @@ -119,7 +119,7 @@ final class ExpectedNameResolver return null; } $expectedName = $this->propertyNaming->getExpectedNameFromType($returnedType); - if ($expectedName !== null) { + if ($expectedName instanceof ExpectedName) { return $expectedName->getName(); } // call with args can return different value, so skip there if not sure about the type @@ -127,22 +127,22 @@ final class ExpectedNameResolver return null; } $expectedNameFromMethodName = $this->propertyNaming->getExpectedNameFromMethodName($name); - if ($expectedNameFromMethodName !== null) { + if ($expectedNameFromMethodName instanceof ExpectedName) { return $expectedNameFromMethodName->getName(); } return null; } public function resolveForForeach(VariableAndCallForeach $variableAndCallForeach) : ?string { - $expr = $variableAndCallForeach->getCall(); - if ($this->isDynamicNameCall($expr)) { + $call = $variableAndCallForeach->getCall(); + if ($this->isDynamicNameCall($call)) { return null; } - $name = $this->nodeNameResolver->getName($expr->name); + $name = $this->nodeNameResolver->getName($call->name); if ($name === null) { return null; } - $returnedType = $this->nodeTypeResolver->getType($expr); + $returnedType = $this->nodeTypeResolver->getType($call); if ($returnedType->isIterable()->no()) { return null; } @@ -168,7 +168,7 @@ final class ExpectedNameResolver } private function isReturnedTypeAnArrayAndExpectedNameFromTypeNotNull(Type $returnedType, ?ExpectedName $expectedName) : bool { - return $returnedType instanceof ArrayType && $expectedName !== null; + return $returnedType instanceof ArrayType && $expectedName instanceof ExpectedName; } /** * @param \PhpParser\Node\Expr\MethodCall|\PhpParser\Node\Expr\StaticCall|\PhpParser\Node\Expr\FuncCall $expr diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 0c1754fa1fe..89f76ceeb71 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 = 'bc69455d8a05c1325d64dac545931594ca1fe4aa'; + public const PACKAGE_VERSION = 'f7b9dd9035931da5a040f5c714c79c32c424b677'; /** * @api * @var string */ - public const RELEASE_DATE = '2023-12-10 00:27:31'; + public const RELEASE_DATE = '2023-12-10 09:03:22'; /** * @var int */