Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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;
}
}
16 changes: 8 additions & 8 deletions src/NodeTypeResolver/NodeTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion src/Rector/AbstractRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading