mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit a0d324465a4cbccb9236bc69f41069da89d01baf
a0d324465a
[Php74][Php81] Allow mixed key on ArraySpreadInsteadOfArrayMergeRector on php 8.1 version feature enabled (#5190)
This commit is contained in:
parent
440cc19f16
commit
c6f40053b8
|
@ -96,6 +96,9 @@ CODE_SAMPLE
|
|||
}
|
||||
private function refactorArray(FuncCall $funcCall) : ?Array_
|
||||
{
|
||||
if ($funcCall->isFirstClassCallable()) {
|
||||
return null;
|
||||
}
|
||||
$array = new Array_();
|
||||
foreach ($funcCall->args as $arg) {
|
||||
if (!$arg instanceof Arg) {
|
||||
|
@ -135,10 +138,8 @@ CODE_SAMPLE
|
|||
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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue