Allow multi-line @var inline variable type declarations

Created on 19 November 2021, over 3 years ago
Updated 11 February 2025, 2 months ago

Problem/Motivation

Followup, taken from #2305593-66: [policy] Set a standard for @var inline variable type declarations

Allow multi-line docs, if a description would add clarity:

/**
 * @var array[][][] $instancesss
 *   Format: $[$entity_type][$bundle][$field_name] = $field_instance
 */
$instances = [];

In cases where a description is not needed, a one-line doc can be used instead.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Closed: works as designed

Component

Coding Standards

Created by

🇳🇿New Zealand quietone

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand quietone

    I don't see that there is anything to do here, the @var can have comments and some do exist in core. I do not see anything in the standards that implies that this is not possible. It is true that none of the examples show extra documentation and I think that is fine.

    At the time I made this issue I was concentrating on making sure that each point from the originating issue had its own issue. I did check it in any other way. So, I think can be closed. Maybe there was a time when a paragraph after the @var was prohibited but no longer.

Production build 0.71.5 2024