Skip to content

Commit

Permalink
Updated Rector to commit a0d324465a4cbccb9236bc69f41069da89d01baf
Browse files Browse the repository at this point in the history
rectorphp/rector-src@a0d3244 [Php74][Php81] Allow mixed key on ArraySpreadInsteadOfArrayMergeRector on php 8.1 version feature enabled (#5190)
  • Loading branch information
TomasVotruba committed Oct 22, 2023
1 parent 440cc19 commit c6f4005
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ public function provideMinPhpVersion() : int
}
private function refactorArray(FuncCall $funcCall) : ?Array_
{
if ($funcCall->isFirstClassCallable()) {
return null;
}
$array = new Array_();
foreach ($funcCall->args as $arg) {
if (!$arg instanceof Arg) {
Expand Down Expand Up @@ -135,10 +138,8 @@ private function isArrayKeyTypeAllowed(ArrayType $arrayType) : bool
if ($arrayType->getKeyType()->isInteger()->yes()) {
return \true;
}
if (!$this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::ARRAY_SPREAD_STRING_KEYS)) {
return \false;
}
return $arrayType->getKeyType()->isString()->yes();
// php 8.1+ allow mixed key: int, string, and null
return $this->phpVersionProvider->isAtLeastPhpVersion(PhpVersionFeature::ARRAY_SPREAD_STRING_KEYS);
}
private function resolveValue(Expr $expr) : Expr
{
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 = '5ac3cb377abf968396c23573d8562e6ab6967f2a';
public const PACKAGE_VERSION = 'a0d324465a4cbccb9236bc69f41069da89d01baf';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-10-19 20:44:46';
public const RELEASE_DATE = '2023-10-22 12:09:33';
/**
* @var int
*/
Expand Down

0 comments on commit c6f4005

Please sign in to comment.