Commit 4a2cf93 1 parent c511185 commit 4a2cf93 Copy full SHA for 4a2cf93
File tree 2 files changed +14
-2
lines changed
src/Psalm/Internal/PhpVisitor/Reflector
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -434,9 +434,11 @@ public function start(PhpParser\Node\Stmt\ClassLike $node): ?bool
434
434
try {
435
435
$ type_string = CommentAnalyzer::splitDocLine ($ type_string )[0 ];
436
436
} catch (DocblockParseException $ e ) {
437
- throw new DocblockParseException (
438
- $ type_string . ' is not a valid type: ' . $ e ->getMessage (),
437
+ $ storage ->docblock_issues [] = new InvalidDocblock (
438
+ $ e ->getMessage () . ' in docblock for ' . $ fq_classlike_name ,
439
+ $ name_location ?? $ class_location ,
439
440
);
441
+ continue ;
440
442
}
441
443
$ type_string = CommentAnalyzer::sanitizeDocblockType ($ type_string );
442
444
try {
Original file line number Diff line number Diff line change @@ -5025,6 +5025,16 @@ function getMixedCollection(MyCollection $c): MyCollection {
5025
5025
} ' ,
5026
5026
'error_message ' => 'InvalidReturnStatement ' ,
5027
5027
],
5028
+ 'noCrashOnBrokenTemplate ' => [
5029
+ 'code ' => <<<'PHP'
5030
+ <?php
5031
+ /**
5032
+ * @template TValidationRule of callable>|string
5033
+ */
5034
+ class C {}
5035
+ PHP,
5036
+ 'error_message ' => 'InvalidDocblock ' ,
5037
+ ],
5028
5038
];
5029
5039
}
5030
5040
}
You can’t perform that action at this time.
0 commit comments