Skip to content

Commit

Permalink
Updated Rector to commit a5bf80cb2fdd49d64777cf13250e7205ddd0a3be
Browse files Browse the repository at this point in the history
rectorphp/rector-src@a5bf80c [TypeDeclaration] Skip possible array on StrictStringParamConcatRector (#5876)
  • Loading branch information
TomasVotruba committed May 14, 2024
1 parent 5dfd1c6 commit 89f91b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,19 @@ public function refactor(Node $node) : ?Node
continue;
}
$nativeType = $this->nodeTypeResolver->getNativeType($variableConcattedFromParam);
if ($nativeType instanceof MixedType && $nativeType->getSubtractedType() instanceof Type && TypeCombinator::containsNull($nativeType->getSubtractedType())) {
$param->type = new NullableType(new Identifier('string'));
} else {
if (!$nativeType instanceof MixedType) {
continue;
}
$subtractedType = $nativeType->getSubtractedType();
if (!$subtractedType instanceof Type) {
$param->type = new Identifier('string');
$hasChanged = \true;
continue;
}
if (TypeCombinator::containsNull($subtractedType)) {
$param->type = new NullableType(new Identifier('string'));
$hasChanged = \true;
}
$hasChanged = \true;
}
if ($hasChanged) {
return $node;
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '7182e19c4b0696ee48ff8c828afe47fd34d36d1c';
public const PACKAGE_VERSION = 'a5bf80cb2fdd49d64777cf13250e7205ddd0a3be';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-05-14 20:09:06';
public const RELEASE_DATE = '2024-05-14 20:46:32';
/**
* @var int
*/
Expand Down

0 comments on commit 89f91b6

Please sign in to comment.