Skip to content

Commit 42c643b

Browse files
committed
handle FiberScope
1 parent e9c0b9d commit 42c643b

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

rules/CodeQuality/Rector/Empty_/SimplifyEmptyCheckOnEmptyArrayRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private function isAllowedVariable(Variable $variable): bool
107107

108108
private function isAllowedExpr(Expr $expr, Scope $scope): bool
109109
{
110-
if (! $scope->getType($scope, $expr)->isArray()->yes()) {
110+
if (! $scope->getType($expr)->isArray()->yes()) {
111111
return false;
112112
}
113113

rules/DeadCode/Rector/If_/RemoveAlwaysTrueIfConditionRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function refactor(Node $node): int|null|array|If_
121121
}
122122

123123
$scope = ScopeFetcher::fetch($node);
124-
$type = $scope->getNativeType($scope, $node->cond);
124+
$type = $scope->getNativeType($node->cond);
125125
if (! $type->isTrue()->yes()) {
126126
return null;
127127
}

rules/DeadCode/Rector/If_/RemoveUnusedNonEmptyArrayBeforeForeachRector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private function isUselessBeforeForeachCheck(If_ $if, Scope $scope): bool
123123
if (($ifCond instanceof Variable || $this->propertyFetchAnalyzer->isPropertyFetch($ifCond))
124124
&& $this->nodeComparator->areNodesEqual($ifCond, $foreachExpr)
125125
) {
126-
$ifType = $scope->getNativeType($scope, $ifCond);
126+
$ifType = $scope->getNativeType($ifCond);
127127
return $ifType->isArray()
128128
->yes();
129129
}
@@ -193,7 +193,7 @@ private function refactorStmtsAware(Node $stmtsAware): ?Node
193193
continue;
194194
}
195195

196-
$ifType = $scope->getNativeType($scope, $empty->expr);
196+
$ifType = $scope->getNativeType($empty->expr);
197197
if (! $ifType->isArray()->yes()) {
198198
continue;
199199
}
@@ -239,7 +239,7 @@ private function shouldSkipForeachExpr(Expr $foreachExpr, Scope $scope): bool
239239
return true;
240240
}
241241

242-
$ifType = $scope->getNativeType($scope, $foreachExpr);
242+
$ifType = $scope->getNativeType($foreachExpr);
243243
if (! $ifType->isArray()->yes()) {
244244
return true;
245245
}

rules/DeadCode/UselessIfCondBeforeForeachDetector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private function areCondExprAndForeachExprSame(Empty_ $empty, Expr $foreachExpr,
126126
}
127127

128128
// is array though?
129-
$arrayType = $scope->getType($scope, $empty->expr);
129+
$arrayType = $scope->getType($empty->expr);
130130
return $arrayType->isArray()
131131
->yes();
132132
}

rules/Strict/Rector/Empty_/DisallowedEmptyRuleFixerRector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private function refactorBooleanNot(BooleanNot $booleanNot, Scope $scope): Expr|
107107
return null;
108108
}
109109

110-
$emptyExprType = $scope->getNativeType($scope, $empty->expr);
110+
$emptyExprType = $scope->getNativeType($empty->expr);
111111

112112
$result = $this->exactCompareFactory->createNotIdenticalFalsyCompare(
113113
$emptyExprType,
@@ -132,7 +132,7 @@ private function refactorEmpty(Empty_ $empty, Scope $scope, bool $treatAsNonEmpt
132132
return null;
133133
}
134134

135-
$exprType = $scope->getNativeType($scope, $empty->expr);
135+
$exprType = $scope->getNativeType($empty->expr);
136136
$result = $this->exactCompareFactory->createIdenticalFalsyCompare($exprType, $empty->expr, $treatAsNonEmpty);
137137
if (! $result instanceof Expr) {
138138
return null;

0 commit comments

Comments
 (0)