Skip to content

Commit 283163f

Browse files
committed
[CodingStyle] Skip non-native array type on PHP 7.4 for ArraySpreadInsteadOfArrayMergeRector
1 parent 6bdd527 commit 283163f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

rules/CodingStyle/Rector/FuncCall/ArraySpreadInsteadOfArrayMergeRector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ private function shouldSkipArrayForInvalidKeys(Expr $expr): bool
135135
$type = $this->getType($expr);
136136

137137
if ($type->getIterableKeyType()->isInteger()->yes()) {
138+
// when on PHP 8.0+, pass non-array values already error on the first place
138139
if (! $this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::ARRAY_ON_ARRAY_MERGE)) {
139140
$nativeType = $this->nodeTypeResolver->getNativeType($expr);
140141
return ! $nativeType->isArray()->yes();

0 commit comments

Comments
 (0)