Fix phpdoc issues with variables passed to array functions

Created on 20 August 2025, 27 days ago

Problem/Motivation

See 📌 Fix strict type errors detected by phpstan Active

There are a number of calls to array functions (e.g. array_map, array_keys, etc) that expect an array, but due to incorrect phpdoc annotations phpstan thinks we're passing something else. Usually this is due to an incorrectly typed multi-dimensional array.

Steps to reproduce

Add checkFunctionArgumentTypes: true to phpstan.neon.dist

$ ./vendor/bin/phpstan analyse -c core/phpstan.neon.dist --error-format=json   | jq '.files | to_entries[]
  | .value.messages[] as $m
  | select($m.message | test("array of function .* expects"))
  | {file: .key, message: $m.message, line: $m.line}'

Note this will reveal a few others, but they are not easily fixed in the same way.

Proposed resolution

Fix phpdocs

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

📌 Task
Status

Active

Version

11.0 🔥

Component

other

Created by

🇦🇺Australia mstrelan

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024