Skip to content

Commit 3026074

Browse files
committed
Revert "remove unnecessary assign when possible"
This reverts commit c69c8e6.
1 parent c69c8e6 commit 3026074

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictParamRector.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,22 +85,21 @@ public function provideMinPhpVersion(): int
8585
*/
8686
public function refactorWithScope(Node $node, Scope $scope): ?Node
8787
{
88-
if ($node->stmts === null) {
88+
$stmts = $node->stmts;
89+
if ($stmts === null) {
8990
return null;
9091
}
9192

9293
if ($this->shouldSkipNode($node)) {
9394
return null;
9495
}
9596

96-
$return = $this->findCurrentScopeReturn($node->stmts);
97+
$return = $this->findCurrentScopeReturn($stmts);
9798
if (! $return instanceof Return_ || ! $return->expr instanceof Expr) {
9899
return null;
99100
}
100101

101102
$returnName = $this->getName($return->expr);
102-
$stmts = $node->stmts;
103-
104103
foreach ($node->getParams() as $param) {
105104
if (! $param->type instanceof Node) {
106105
continue;

0 commit comments

Comments
 (0)