mirror of https://github.com/rectorphp/rector.git
Updated Rector to commit c639ef8ad9213881d4fe08554f090934bc5dda07
c639ef8ad9
RemoveUnusedNonEmptyArrayBeforeForeachRector: ignore phpdoc types (#5169)
This commit is contained in:
parent
727c62f465
commit
4c4ad160dd
|
@ -120,13 +120,17 @@ CODE_SAMPLE
|
|||
if (\is_string($variableName) && $this->reservedKeywordAnalyzer->isNativeVariable($variableName)) {
|
||||
return \false;
|
||||
}
|
||||
$ifType = $scope->getNativeType($foreachExpr);
|
||||
if (!$ifType->isArray()->yes()) {
|
||||
return \false;
|
||||
}
|
||||
}
|
||||
$ifCond = $if->cond;
|
||||
if ($ifCond instanceof BooleanAnd) {
|
||||
return $this->isUselessBooleanAnd($ifCond, $foreachExpr);
|
||||
}
|
||||
if (($ifCond instanceof Variable || $this->propertyFetchAnalyzer->isPropertyFetch($ifCond)) && $this->nodeComparator->areNodesEqual($ifCond, $foreachExpr)) {
|
||||
$ifType = $scope->getType($ifCond);
|
||||
$ifType = $scope->getNativeType($ifCond);
|
||||
return $ifType->isArray()->yes();
|
||||
}
|
||||
if ($this->uselessIfCondBeforeForeachDetector->isMatchingNotIdenticalEmptyArray($if, $foreachExpr)) {
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = 'd55a35bcdede830d3927de1c11e0f7f0d12ee9e4';
|
||||
public const PACKAGE_VERSION = 'c639ef8ad9213881d4fe08554f090934bc5dda07';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2023-10-13 22:53:35';
|
||||
public const RELEASE_DATE = '2023-10-14 19:48:51';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue