Provide examples for phpdoc allowed types

Created on 20 May 2025, about 2 months ago

Problem/Motivation

In Adopt phpstan phpdoc types as canonical reference of allowed types Active we changed the docs for what a valid param type is.
In that process some examples were removed. Evaluate if we need to add some back.

Benefits

Better coding standards docs.

Three supporters required

Proposed changes

Review Adopt phpstan phpdoc types as canonical reference of allowed types Active and evaluate if new examples need to be added to data types in documentation

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. Discussed by the Core Committer Committee, if it impacts Drupal Core
  6. Final review by Coding Standards Committee
  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

Feature request
Status

Active

Component

Coding Standards

Created by

🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

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

Comments & Activities

  • Issue created by @penyaskito
  • 🇺🇸United States xjm

    I think something we especially need to add guidance like:

    Where possible, document the array shapes. For example:

    array{'foo': int, 'bar': string}
    

    ...and showing a preference about quoting the associative keys would be nice.

Production build 0.71.5 2024