Skip to content

fix(stubs): SPL classes and WeakMap use the PHP 8 parameter names - #14353

Merged
orklah merged 2 commits into
vimeo:masterfrom
jirkace:fix/14131-stub-param-names
Nov 24, 2026
Merged

orklah merged 2 commits into
vimeo:masterfrom
jirkace:fix/14131-stub-param-names

Conversation

@jirkace

@jirkace jirkace commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Named arguments that use the PHP 8 parameter names of SPL classes and WeakMap report a false InvalidNamedArgument, and overrides using them a false ParamNameMismatch, because the stubs keep the legacy names.

Before

$fixed = SplFixedArray::fromArray([1, 2], preserveKeys: false); // InvalidNamedArgument: Parameter $preserveKeys does not exist on function SplFixedArray::fromArray
$list = new SplDoublyLinkedList();
$list->add(index: 0, value: 1); // InvalidNamedArgument
$regex = new RegexIterator(new ArrayIterator([]), pattern: "/a/", pregFlags: 0); // InvalidNamedArgument

After

$fixed = SplFixedArray::fromArray([1, 2], preserveKeys: false); // no issue
$list->add(index: 0, value: 1); // no issue
$regex = new RegexIterator(new ArrayIterator([]), pattern: "/a/", pregFlags: 0); // no issue

Covers SplDoublyLinkedList, SplFixedArray, DirectoryIterator, FilesystemIterator, RecursiveDirectoryIterator, RegexIterator, RecursiveRegexIterator, RecursiveTreeIterator, MultipleIterator and WeakMap. The names of ArrayObject and ArrayIterator are in #14324, the extension stubs (Redis, Memcached, SOAP, ...) are left for another change.

Refs #14131

…eo#14131

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Performance: unchanged · Types: unchanged

Project Memory (MB) Wall (s) Issues Weighted (types) Taint Dead code
✅ laravel 1 768 96.8 $\color{gray}{\textsf{+0.6\%}}$ 25 691 52 994 682 0
✅ symfony 3 596 227.0 $\color{gray}{\textsf{+0.1\%}}$ 50 604 98 386 1 528 0
✅ doctrine-orm 380 13.8 $\color{gray}{\textsf{-2.1\%}}$ 3 476 6 143 0 0
✅ psl 617 17.1 $\color{gray}{\textsf{-4.4\%}}$ 1 375 5 612 1 0
✅ phpunit 455 15.7 $\color{gray}{\textsf{+0.6\%}}$ 1 731 3 410 18 0
✅ php-parser 226 10.5 $\color{gray}{\textsf{+1.8\%}}$ 17 118 21 193 0 0
✅ tempest 895 27.7 $\color{gray}{\textsf{-1.1\%}}$ 5 047 10 528 252 0
✅ amphp-amp 45 1.5 $\color{gray}{\textsf{-0.7\%}}$ 29 49 0 0
✅ webmozarts-assert 272 4.8 $\color{gray}{\textsf{-1.0\%}}$ 575 2 714 0 0
✅ guzzle-promises 44 1.6 $\color{gray}{\textsf{+0.6\%}}$ 155 434 2 0
✅ monolog 135 5.8 913 2 479 10 0
✅ drupal 4 839 237.8 $\color{gray}{\textsf{+1.1\%}}$ 97 575 169 202 583 0
✅ wordpress 2 038 189.2 $\color{gray}{\textsf{+0.5\%}}$ 142 681 676 628 461 1
Total 15 312 849.3 $\color{gray}{\textsf{+0.4\%}}$ 346 970 1 049 772 3 537 1
How to read this table
  • Memory: Psalm's own peak figure, threads=1. More than +5 % fails, unless the PR changes composer.json.
  • Wall: base and head run on the same runner; ±10 % is noise. Above +10 % warns, never fails. re-run: a reversed second run was taken and the faster kept.
  • Issues: head count over all categories, then $\color{red}{\textsf{+added}}$ $\color{green}{\textsf{-removed}}$ against base.
  • Weighted (types): type issues weighted by error level (levels 1–8 as is, always-errors 10, strictness checks 1). Taint and dead-code issues are not weighed. The projects' own code is pinned and their dependencies resolve identically for base and head, so a change means Psalm reports more, fewer or differently serious issues. A rise is not necessarily a regression.
  • Taint: head count of Tainted* issues, then $\color{orange}{\textsf{+added}}$ $\color{orange}{\textsf{-removed}}$ against base. Both are orange as either direction needs review: more can be new detection or false positives, fewer can be fixed false positives or lost detection.
  • Dead code: head count of unused-code issues, shown only when a run reported some (findUnusedCode). More is red, fewer is green.
  • Total: sum over the projects compared on both sides. Its wall time warns above +5 % (±5 % is noise); the other thresholds apply per project.
  • Colors: $\color{red}{\textsf{red}}$ past a fail or warn threshold (or more issues), $\color{green}{\textsf{green}}$ an improvement past noise (or fewer issues), $\color{orange}{\textsf{orange}}$ needs review, $\color{gray}{\textsf{gray}}$ noise.
  • Performance: regressed if a head run crashed or timed out or a memory or wall delta is red, else improved if one is green, else unchanged. Its icon is the check result: ❌ fail · ⚠️ warn · ✅ pass; the icon next to each project is that project's result, 💥 = not comparable: base crashed or timed out (counts as ⚠️).
  • Types (heading): direction of the total weighted change, increased · decreased · unchanged. Taint and Dead code (heading): added and removed counts, present only when non-zero. Informational, never fails the check.

head 478e58a · base 28e192b (merge-base) · workflow run

@orklah orklah added the release:fix The PR will be included in 'Fixes' section of the release notes label Nov 24, 2026
@orklah

orklah commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Thanks @jirkace!

@orklah
orklah merged commit 3c3f52d into vimeo:master Nov 24, 2026
72 of 73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:fix The PR will be included in 'Fixes' section of the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants