Using '&' in doxygen @param documentation

Created on 12 December 2011, over 12 years ago
Updated 19 July 2024, about 2 months ago

Problem/Motivation

Coming from #1366842: False positives for pass-by-reference parameters :

Currently we have no coding standard how we document parameters that are passed by reference to a function. Drupal core does not document the ampersand ('&') in the @param documentation, which is bad because then it is not visible in the documentation that the parameter is taken as reference.

Proposed resolution

Change the coding standards to recommend documenting the '&' in the @param doc blocks. Example:

/**
 * Function description and bla bla.
 *
 * @param array &$foobar
 *   A fancy configuration array that is magically changed in this function.
 *
 */
function example_function(array &$foobar) {
  ...
}

Remaining tasks

Discussion if this is what we want, then adding the outcome to the coding standards.

User interface changes

None.

API changes

None.

📌 Task
Status

Closed: won't fix

Component

Documentation

Created by

🇦🇹Austria klausi 🇦🇹 Vienna

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

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.

Production build 0.71.5 2024