mirror of
https://github.com/antonioribeiro/google2fa.git
synced 2026-04-25 08:05:49 +03:00
[PR #197] [MERGED] PHPStan level 9 with bleeding edge #441
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/google2fa#441
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/antonioribeiro/google2fa/pull/197
Author: @spaze
Created: 2/29/2024
Status: ✅ Merged
Merged: 9/7/2024
Merged by: @antonioribeiro
Base:
9.x← Head:spaze/phpstan++📝 Commits (4)
616a46bUpdate PHPStan level to 655a31b6PHPStan level 87ea7122PHPStan level 9/max685f17dOpt in to bleeding edge, no changes needed, woohoo📊 Changes
12 files changed (+116 additions, -61 deletions)
View changed files
📝
phpstan.neon(+4 -1)➕
src/Exceptions/Contracts/InvalidHash.php(+9 -0)📝
src/Exceptions/IncompatibleWithGoogleAuthenticatorException.php(+1 -0)📝
src/Exceptions/InvalidAlgorithmException.php(+1 -0)📝
src/Exceptions/InvalidCharactersException.php(+1 -0)➕
src/Exceptions/InvalidHashException.php(+19 -0)📝
src/Exceptions/SecretKeyTooShortException.php(+1 -0)📝
src/Google2FA.php(+26 -18)📝
src/Support/Base32.php(+6 -4)📝
tests/Google2FATest.php(+42 -35)📝
tests/QRCodeTest.php(+1 -1)📝
tests/helpers.php(+5 -2)📄 Description
Update PHPStan level to 9/max with bleeding edge. You can't go any higher :-) #172 inspired me to do this, to make sure the types are correct throughout the lib.
Native types could be used instead of docblocks if support for older PHP version is dropped, but first I wanted to make sure the lib is on a highest possible PHPStan level to make adding native types a bit safer. Can add them in a next PR once this is merged for example.
This branch is based on #196 branch to make tests run on all PHP versions, probably should be rebased before merging, can take care of that.
I'm not sure what to do with the failing Style CI test that wants me to update a preexisting code like this:
I can update it if it looks like what's expected.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.