Skip to content

Commit a6e4053

Browse files
committed
run rector
1 parent d6200f2 commit a6e4053

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

rules/CodeQuality/Rector/Class_/YieldDataProviderRector.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
use Rector\Comments\NodeDocBlock\DocBlockUpdater;
2323
use Rector\DeadCode\NodeAnalyzer\IsClassMethodUsedAnalyzer;
2424
use Rector\NodeTypeResolver\Node\AttributeKey;
25-
use Rector\PhpParser\Node\BetterNodeFinder;
2625
use Rector\PhpParser\NodeTransformer;
2726
use Rector\PHPStan\ScopeFetcher;
2827
use Rector\PHPUnit\NodeAnalyzer\TestsNodeAnalyzer;
@@ -47,7 +46,6 @@ public function __construct(
4746
private readonly IsClassMethodUsedAnalyzer $isClassMethodUsedAnalyzer,
4847
private readonly PhpDocTypeChanger $phpDocTypeChanger,
4948
private readonly DocBlockUpdater $docBlockUpdater,
50-
private readonly BetterNodeFinder $betterNodeFinder,
5149
) {
5250
}
5351

@@ -137,24 +135,21 @@ private function collectReturnArrayNodesFromClassMethod(ClassMethod $classMethod
137135
if ($statement instanceof Expression) {
138136
$statement = $statement->expr;
139137
}
140-
141138
if ($statement instanceof Return_) {
142139
$returnedExpr = $statement->expr;
143-
144140
if (! $returnedExpr instanceof Array_) {
145141
return null;
146142
}
147-
148143
return $returnedExpr;
149-
} elseif ($statement instanceof YieldFrom) {
144+
}
145+
146+
if ($statement instanceof YieldFrom) {
150147
if (! $statement->expr instanceof Array_) {
151148
return null;
152149
}
153-
154-
if ($yieldedFromExpr !== null) {
150+
if ($yieldedFromExpr instanceof Array_) {
155151
return null;
156152
}
157-
158153
$yieldedFromExpr = $statement->expr;
159154
} elseif (
160155
! $statement instanceof Assign

0 commit comments

Comments
 (0)