Skip to content

Commit 84995bb

Browse files
committed
ReturnTypeExtension: better expandability
1 parent 80299cd commit 84995bb

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/TypeValidator/PHPStan/Type/ReturnTypeExtension.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ protected function narrowTypes(array $args, Analyser\Scope $scope): Analyser\Spe
5151
}
5252

5353

54-
protected function prepareType(Node\Expr $typeDescriptionArg, Analyser\Scope $scope): Type\Type
54+
protected function prepareType(
55+
Node\Expr $typeDescriptionArg,
56+
Analyser\Scope $scope,
57+
string|null &$typeDescription = null,
58+
): Type\Type
5559
{
5660
$filename = $scope->getFile();
5761

@@ -80,7 +84,7 @@ protected function prepareType(Node\Expr $typeDescriptionArg, Analyser\Scope $sc
8084
}
8185

8286

83-
private static function error(string $filename, string $message, Node\Expr $arg): never
87+
final protected static function error(string $filename, string $message, Node\Expr $arg): never
8488
{
8589
throw new Parser\ParserErrorsException([new Error($message, ['startLine' => $arg->getLine()])], $filename);
8690
}

0 commit comments

Comments
 (0)