Skip to content

Commit eb23e72

Browse files
committed
Remove tentative return types
1 parent 1ca6fc9 commit eb23e72

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

extractor/extract.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,11 @@ private function compareStatementsInNamespace(array $oldStmts, array $newStmts,
360360
*/
361361
private function compareFunctions(Node\FunctionLike $old, Node\FunctionLike $new, string $updateTo): array
362362
{
363+
if ($old->getReturnType() === null && $new->getReturnType() !== null) {
364+
if ($new->getDocComment() !== null && strpos($new->getDocComment()->getText(), '@tentative-return-type') !== 0) {
365+
$new->returnType = null; // @phpstan-ignore-line
366+
}
367+
}
363368
if ($this->printType($old->getReturnType()) !== $this->printType($new->getReturnType())) {
364369
return $this->functionDiff($old, $new, $updateTo);
365370
}

0 commit comments

Comments
 (0)