Skip to content

Support Psalm 7 - #20

Merged
veewee merged 3 commits into
php-standard-library:mainfrom
alies-dev:psalm-7
Nov 20, 2026
Merged

veewee merged 3 commits into
php-standard-library:mainfrom
alies-dev:psalm-7

Conversation

@alies-dev

@alies-dev alies-dev commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🤖

The >=5.16 constraint lets the plugin install with Psalm 7, and Psalm 7 then crashes on the first Type\shape() call:

Uncaught Error: Call to private Psalm\Type\Atomic\TKeyedArray::__construct()

Regex\capture_groups() and Fun\pipe() crash too. Psalm 7 made the TKeyedArray constructor private and removed the $value parameter of TClosure.

I switched to TKeyedArray::make() (available since Psalm 6.19) and Type::getClosure(), so the plugin now supports ^6.19 || ^7. Inferred types are unchanged. Older Psalm versions keep getting 2.4.0.

To get CI running on these versions:

  • php-cs-fixer v2 blocked installing anything newer than Psalm 6.13, so I upgraded it to v3.
  • Added #[Override], which newer Psalm requires.
  • Added type tests (tests/types) and run them against Psalm 6 and 7 on PHP 8.4, which PSL 6 needs.

The static analysis workflow is disabled for inactivity and needs re-enabling in the Actions tab.

v2 caps symfony/filesystem at ^5, which blocks installing Psalm 6.14+
and Psalm 7.
- build TKeyedArray through make(): Psalm 7 made the constructor private
  (make() exists since Psalm 6.19)
- build TClosure through Type::getClosure(): Psalm 7 dropped the
  constructor's leading $value parameter
- add #[Override] attributes, required by self-analysis on Psalm 6.19+
- run static analysis against both Psalm 6 and 7
PSL requires PHP 8.4, so CI runs on 8.4.
@veewee
veewee merged commit 8479a81 into php-standard-library:main Nov 20, 2026
4 checks passed
@veewee

veewee commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Looks good, thanks!

@veewee veewee mentioned this pull request Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants