Skip to content

Update PHPStan & Psalm to the latest versions#232

Open
spaze wants to merge 5 commits intoantonioribeiro:10.xfrom
spaze:spaze/update-phpstan-psalm
Open

Update PHPStan & Psalm to the latest versions#232
spaze wants to merge 5 commits intoantonioribeiro:10.xfrom
spaze:spaze/update-phpstan-psalm

Conversation

@spaze
Copy link
Contributor

@spaze spaze commented Nov 23, 2025

Also:

  • Added the final keyword to classes
  • Added Override attribute to tests
  • Simplified the timestamp calculation instead of typecasting the return values from microtime() or the $keyRegeneration property

@spaze spaze changed the title Update PHPStan & Psalm to latest versions Update PHPStan & Psalm to the latest versions Nov 23, 2025
@antonioribeiro
Copy link
Owner

Hey @spaze, sorry but making the main Google2FA class final is too heavy-handed. I don't want to make it unextendable. I'm pretty much with the "old" Taylor here:

"...in open source code it's so bad to come across a final class and you just can't extend it and, ugh, whatever."

@spaze
Copy link
Contributor Author

spaze commented Feb 4, 2026

You could still use composition instead of inheritance but we could debate it for a long time, especially when it comes to security-related classes. Psalm added the rule some time ago, but it could be ignored. Happy to do it and have at least the other commits in this PR, feel free to reopen :-)

@antonioribeiro antonioribeiro reopened this Feb 4, 2026
spaze added 3 commits February 4, 2026 22:58
Psalm reports "Cannot process ints and floats in strict binary operands mode, please cast explicitly" but I think the code can be simplified instead of casting.
@spaze spaze force-pushed the spaze/update-phpstan-psalm branch from 675407c to 0503747 Compare February 4, 2026 21:58
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