Should the '&' be included in @param for variables passed by reference

Created on 1 December 2023, over 1 year ago
Updated 16 July 2024, 9 months ago

Problem/Motivation

The question of whether or not to include the '&' came up in this comment πŸ“Œ Correct $suggestions documentation in hook_theme_suggestions_alter() Fixed in a core issue. The current Drupal standard for @param β†’ does not mention parameters passed by reference.

My searching didn't uncover an answer although there is a similar question on stackoverflow.

Benefits

If we adopted this change, the Drupal Project would benefit by ...

Three supporters required

  1. https://www.drupal.org/u/ β†’ {userid} (date that user added support)
  2. https://www.drupal.org/u/ β†’ {userid} (date that user added support)
  3. https://www.drupal.org/u/ β†’ {userid} (date that user added support)

Proposed changes

Provide all proposed changes to the Drupal Coding standards β†’ . Give a link to each section that will be changed, and show the current text and proposed text as in the following layout:

1. {link to the documentation heading that is to change}

Add current text in blockquotes

Add proposed text in blockquotes

2. Repeat the above for each page or sub-page that needs to be changed.

Remaining tasks

  1. Add supporters
  2. Create a Change Record
  3. Review by the Coding Standards Committee
  4. Coding Standards Committee takes action as required
  5. Tagged with 'Needs documentation edits' if Core is not affected
  6. Discussed by the Core Committer Committee, if it impacts Drupal Core
  7. Documentation updates
    1. Edit all pages
    2. Publish change record
    3. Remove 'Needs documentation edits' tag
  8. If applicable, create follow-up issues for PHPCS rules/sniffs changes

For a full explanation of these steps see the Coding Standards project page β†’

πŸ“Œ Task
Status

Closed: duplicate

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

Production build 0.71.5 2024