mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
parent
c511185fbe
commit
4a2cf93d7a
@ -434,9 +434,11 @@ final class ClassLikeNodeScanner
|
|||||||
try {
|
try {
|
||||||
$type_string = CommentAnalyzer::splitDocLine($type_string)[0];
|
$type_string = CommentAnalyzer::splitDocLine($type_string)[0];
|
||||||
} catch (DocblockParseException $e) {
|
} catch (DocblockParseException $e) {
|
||||||
throw new DocblockParseException(
|
$storage->docblock_issues[] = new InvalidDocblock(
|
||||||
$type_string . ' is not a valid type: ' . $e->getMessage(),
|
$e->getMessage() . ' in docblock for ' . $fq_classlike_name,
|
||||||
|
$name_location ?? $class_location,
|
||||||
);
|
);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
$type_string = CommentAnalyzer::sanitizeDocblockType($type_string);
|
$type_string = CommentAnalyzer::sanitizeDocblockType($type_string);
|
||||||
try {
|
try {
|
||||||
|
@ -5025,6 +5025,16 @@ class ClassTemplateTest extends TestCase
|
|||||||
}',
|
}',
|
||||||
'error_message' => 'InvalidReturnStatement',
|
'error_message' => 'InvalidReturnStatement',
|
||||||
],
|
],
|
||||||
|
'noCrashOnBrokenTemplate' => [
|
||||||
|
'code' => <<<'PHP'
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @template TValidationRule of callable>|string
|
||||||
|
*/
|
||||||
|
class C {}
|
||||||
|
PHP,
|
||||||
|
'error_message' => 'InvalidDocblock',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user