From 913e1b37fb3a90e159940ba252983a8f3e794e82 Mon Sep 17 00:00:00 2001 From: TomasVotruba <924196+TomasVotruba@users.noreply.github.com> Date: Sun, 31 Aug 2025 00:37:20 +0000 Subject: [PATCH] [automated] Apply Coding Standard --- .../ArrayKeyExistsNullToEmptyStringRector.php | 10 +++++----- src/NodeTypeResolver/NodeTypeResolver.php | 16 ++++++++-------- src/Rector/AbstractRector.php | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/rules/Php85/Rector/FuncCall/ArrayKeyExistsNullToEmptyStringRector.php b/rules/Php85/Rector/FuncCall/ArrayKeyExistsNullToEmptyStringRector.php index 84d8c80d9da..b061f553d50 100644 --- a/rules/Php85/Rector/FuncCall/ArrayKeyExistsNullToEmptyStringRector.php +++ b/rules/Php85/Rector/FuncCall/ArrayKeyExistsNullToEmptyStringRector.php @@ -105,6 +105,11 @@ public function refactor(Node $node): ?Node return null; } + public function provideMinPhpVersion(): int + { + return PhpVersionFeature::DEPRECATE_NULL_ARG_IN_ARRAY_KEY_EXISTS_FUNCTION; + } + /** * @param Arg[] $args */ @@ -118,9 +123,4 @@ private function resolvePosition(array $args): int return 0; } - - public function provideMinPhpVersion(): int - { - return PhpVersionFeature::DEPRECATE_NULL_ARG_IN_ARRAY_KEY_EXISTS_FUNCTION; - } } diff --git a/src/NodeTypeResolver/NodeTypeResolver.php b/src/NodeTypeResolver/NodeTypeResolver.php index 5ae596a31c1..6cde992ec83 100644 --- a/src/NodeTypeResolver/NodeTypeResolver.php +++ b/src/NodeTypeResolver/NodeTypeResolver.php @@ -255,14 +255,6 @@ public function isNullableType(Node $node): bool return TypeCombinator::containsNull($nodeType); } - private function correctType(Type $type): Type - { - $type = $this->accessoryNonEmptyStringTypeCorrector->correct($type); - $type = $this->genericClassStringTypeCorrector->correct($type); - - return $this->accessoryNonEmptyArrayTypeCorrector->correct($type); - } - public function getNativeType(Expr $expr): Type { $scope = $expr->getAttribute(AttributeKey::SCOPE); @@ -376,6 +368,14 @@ public function isMethodStaticCallOrClassMethodObjectType(Node $node, ObjectType return $classReflection->hasTraitUse($objectType->getClassName()); } + private function correctType(Type $type): Type + { + $type = $this->accessoryNonEmptyStringTypeCorrector->correct($type); + $type = $this->genericClassStringTypeCorrector->correct($type); + + return $this->accessoryNonEmptyArrayTypeCorrector->correct($type); + } + /** * Allow pull type from * diff --git a/src/Rector/AbstractRector.php b/src/Rector/AbstractRector.php index 050b56c21ff..5e22b99ec2b 100644 --- a/src/Rector/AbstractRector.php +++ b/src/Rector/AbstractRector.php @@ -356,7 +356,7 @@ private function postRefactorProcess( $firstNode = current($refactoredNode); if ($firstNode->getAttribute(AttributeKey::HAS_MERGED_COMMENTS, false) === false) { - $this->mirrorComments($firstNode, $originalNode); + $this->mirrorComments($firstNode, $originalNode); } $this->refreshScopeNodes($refactoredNode, $filePath, $currentScope);