Update the data types we use in doc comments

Created on 6 August 2025, about 1 month ago

Change record: Data types must be compliant with the PHPDoc Type syntax as documented by PHPStan

While I think most or all of the types we use should still be compliant, we definitely have a lot of potential for improvement where we use, e.g., array or string[] but more specific types could be used and would certainly help developers working with this module.

📌 Task
Status

Active

Version

1.0

Component

General code

Created by

🇦🇹Austria drunken monkey Vienna, Austria

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

Merge Requests

Comments & Activities

  • Issue created by @drunken monkey
  • First commit to issue fork.
  • 🇮🇳India neerajsingh IN 🇮🇳

    Created a MR with, updates to doc comments for array. This needs to be reviewed for any further data type updates.

  • Pipeline finished with Success
    28 days ago
    Total: 815s
    #571356
  • 🇦🇹Austria drunken monkey Vienna, Austria

    Thanks, that’s a great start!
    However, just looking at Index and IndexInterface I saw a bunch of more places where types were too unspecific (and even found a bug, 🐛 Fix Index::setProcessors() to not assume $processors is keyed by plugin ID Active , though that‘s beside the point). Not really sure how we can get close to a complete MR for this. Seems like a ton of work, and very hard to review and validate. But just doing this piecemeal is also a bit unsatisfactory (and hard to lose track).

    Suggestions are welcome.

  • 🇦🇹Austria drunken monkey Vienna, Austria

    Cleaned up the rest of Index and IndexInterface and then just merged this as a first step.

    Judging by git grep -lE '@(param|var|return) (array( |$)|.*\[\])', there are now still 178 files with … 623 (potentially) suboptimal type hints left. I think form or render arrays can probably keep the simple array type hint, but probably there’s no other place where we cannot improve this (or TYPE[]) to array<KEY_TYPE, TYPE> or list<TYPE>.

    So, maybe child issues for separate batches of these files, or maybe based on parent directory? What would be a good batch size?
    I don’t want to divide this too finely and just create a huge flood of contrib credits, but it is tedious work and I don’t think anyone is willing to create or review a single MR for 50 files of this.

  • Now that this issue is closed, please review the contribution record.

    As a contributor, attribute any organization helped you, or if you volunteered your own time.

    Maintainers, please credit people who helped resolve this issue.

Production build 0.71.5 2024