Skip to content

Commit 9a13907

Browse files
committed
simplify
1 parent ab31637 commit 9a13907

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Rules/TooWideTypehints/TooWideTypeCheck.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,22 @@ public function checkFunction(
8686
return [];
8787
}
8888

89-
$functionReturnTypes = [];
89+
$returnTypes = [];
9090
foreach ($returnStatements as $returnStatement) {
9191
$returnNode = $returnStatement->getReturnNode();
9292
if ($returnNode->expr === null) {
93-
$functionReturnTypes[] = new VoidType();
93+
$returnTypes[] = new VoidType();
9494
continue;
9595
}
9696

97-
$functionReturnTypes[] = $returnStatement->getScope()->getType($returnNode->expr);
97+
$returnTypes[] = $returnStatement->getScope()->getType($returnNode->expr);
9898
}
9999

100100
if (!$statementResult->isAlwaysTerminating()) {
101-
$functionReturnTypes[] = new VoidType();
101+
$returnTypes[] = new VoidType();
102102
}
103103

104-
$returnType = TypeCombinator::union(...$functionReturnTypes);
104+
$returnType = TypeCombinator::union(...$returnTypes);
105105

106106
// Do not require to have @return null/true/false in descendant classes
107107
if (

0 commit comments

Comments
 (0)