Skip to content

Fix psalm errors: update phpVersion in psalm.xml from 7.4 to 8.2 - #1001

Closed
knofte wants to merge 1 commit into
postfixadmin:masterfrom
knofte:fix-psalm-totp-errors
Closed

Fix psalm errors: update phpVersion in psalm.xml from 7.4 to 8.2#1001
knofte wants to merge 1 commit into
postfixadmin:masterfrom
knofte:fix-psalm-totp-errors

Conversation

@knofte

@knofte knofte commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes all 5 psalm errors that have been causing CI failures.

Root cause

psalm.xml had phpVersion="7.4" but composer.json requires php >= 8.2. This caused psalm to fail parsing PHP 8.1+ syntax (readonly properties) in the spomky-labs/otphp library, making it unable to resolve the OTPHP\TOTP class hierarchy and producing cascading MissingDependency, UndefinedMethod, and PossiblyUnusedParam errors.

Fix

Update phpVersion from "7.4" to "8.2" in psalm.xml to match the minimum PHP version in composer.json. No suppressions needed.

Result

No errors found!

Test plan

  • composer psalm — 0 errors
  • composer check-format — 0 issues
  • PHPUnit 8.3 — 74 tests, 976 assertions, all pass

psalm.xml had phpVersion="7.4" but composer.json requires PHP >=8.2.
This caused psalm to fail parsing PHP 8.1+ syntax (readonly properties)
in the OTPHP library, making it unable to resolve the TOTP class
hierarchy and producing cascading MissingDependency/UndefinedMethod errors.
@knofte
knofte force-pushed the fix-psalm-totp-errors branch from d2af07a to 02f195a Compare March 30, 2026 20:10
@knofte knofte changed the title Fix psalm errors caused by unresolvable OTPHP class hierarchy Fix psalm errors: update phpVersion in psalm.xml from 7.4 to 8.2 Mar 30, 2026
@DavidGoodwin

Copy link
Copy Markdown
Member

I think your robot just needs to remove the phpVersion attribute from psalm.xml.

@knofte

knofte commented Mar 30, 2026

Copy link
Copy Markdown
Contributor Author

I think your robot just needs to remove the phpVersion attribute from psalm.xml.

Haha yeah, sometimes need manual intervention to help it think better :)

@DavidGoodwin

Copy link
Copy Markdown
Member

replaced with 7dc1440

@knofte
knofte deleted the fix-psalm-totp-errors branch March 31, 2026 07:07
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