Problem/Motivation

In #3468236: Adopt phpstan phpdoc types as canonical reference of allowed types 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 #3468236: Adopt phpstan phpdoc types as canonical reference of allowed types and evaluate if new examples need to be added to data types in documentation

Remaining tasks

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

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

Comments

penyaskito created an issue.

xjm’s picture

I think something we especially need to add guidance like:

Where possible, document the array or object shapes. For example:

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

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