Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Inline @var comments are useful for some IDEs to provide code complete feature for developers, such as PHPStorm.
But there is no standard about it as I know -- Checked API documentation and comment standards
In Drupal and contrib modules, I saw two styles are used, starts with /** @var
and /*
Proposed resolution
As it's an inline comment, I suggest using /*
Pointed by @kaysenlau according to phpDocumentor, should use /** @var
class Foo
{
/** @var string|null Should contain a description */
protected $description = null;
}
Remaining tasks
- Needs discussion
- Replace all comments in core following the new unified standard
Comments
Comment #2
jungleUpdate summary and mark this as duplicate