Unable to annotate class constant with `@var`
janedbal opened this issue · comments
Jan Nedbal commented
I'm unable to properly annotate class const, error of SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration.InvalidFormat
is always reported as there is no $
in there:
class Example
{
/**
* @var list<MyEnum> For PHPStorm
*/
final public const ENUM_LIST = [
MyEnum::One
MyEnum::Two,
];
}
Error:
Invalid inline documentation comment format "@var list<MyEnum> For PHPStorm", expected "@var type $variableName Optional description"
Note: this is rarely needed, but sometimes PHPStorm does not properly infer types from consts.
Jaroslav Hanslík commented
Thank you for your report.
Fixed in 789275d
Jan Nedbal commented
Oh, the problem was in final const, thanks!
github-actions commented
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.