Skip to content

Commit 78bbcb0

Browse files
Update rules/CodeQuality/Rector/Class_/AddReturnTypeToDependedRector.php
Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
1 parent 4471d55 commit 78bbcb0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

rules/CodeQuality/Rector/Class_/AddReturnTypeToDependedRector.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,10 @@ public function refactor(Node $node): ?Node
106106
continue;
107107
}
108108

109-
if ($this->silentVoidResolver->hasSilentVoid($classMethod)) {
110-
continue;
109+
$returns = $this->betterNodeFinder->findReturnsScoped($functionLike);
110+
if (! $this->returnAnalyzer->hasOnlyReturnWithExpr($functionLike, $returns)) {
111+
return null;
111112
}
112-
113-
$returns = $this->betterNodeFinder->findReturnsScoped($classMethod);
114113
if (count($returns) !== 1) {
115114
continue;
116115
}

0 commit comments

Comments
 (0)