1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Catch type exception when fixing local type

This commit is contained in:
Matt Brown 2018-04-05 17:18:49 -04:00
parent 81f167df65
commit 6abbc23947

View File

@ -70,11 +70,15 @@ class CommentChecker
throw new IncorrectDocblockException('Misplaced variable');
}
$var_type_string = Type::fixUpLocalType(
$line_parts[0],
$aliases,
$template_types
);
try {
$var_type_string = Type::fixUpLocalType(
$line_parts[0],
$aliases,
$template_types
);
} catch (TypeParseTreeException $e) {
throw new DocblockParseException($line_parts[0] . ' is not a valid type');
}
$original_type = $line_parts[0];