Repository navigation
Enable checked-exception analysis and fix input validation failures #292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5d11fb4
c65e3ee
3a8c923
a927f7a
cf37a21
12d0884
d50ffa2
21a072e
68e7b20
417e5e7
166ada5
46518c1
25e73a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,16 @@ parameters: | |
| paths: | ||
| - src | ||
| - tests | ||
| exceptions: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Release order for the 4 STF-1850 PRs. This comment is the same on each of them:
Reader #299 and web-service-common #142 add Suggested order:
🤖 Comment by Claude Opus 5.5.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. The downstream fixes are now pushed here and in maxmind/GeoIP2-php#348. Both repos pass PHPStan and PHPUnit with released dependencies and with the revised upstream source. Merge the downstream PRs before releasing maxmind/MaxMind-DB-Reader-php#299 and maxmind/web-service-common-php#142. Dependency minimums and obsolete compatibility ignores can be updated after release. 🤖 Comment by Codex on behalf of Greg. |
||
| # These classes signal programmer errors, so callers need not declare them. | ||
| uncheckedExceptionClasses: | ||
| - Error | ||
| - LogicException | ||
| check: | ||
| missingCheckedExceptionInThrows: true | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment is about The "Adding New Validation" template in 🤖 Comment by Claude Opus 5.5.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 46518c1. The PHPDoc step and validation template in 🤖 Comment by Codex on behalf of Greg. |
||
| ignoreErrors: | ||
| # PHPUnit handles exceptions from test methods and their helpers. | ||
| - | ||
| identifier: missingType.checkedException | ||
| path: tests/* | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This For example, 🤖 Comment by Claude Opus 5.5.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in a927f7a. The config comment now explicitly covers test methods and their helpers. The ignore also sets 🤖 Comment by Codex on behalf of Greg. |
||
| reportUnmatched: false | ||
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entry describes a PHPDoc-only change. But the new
@throws InvalidInputExceptionon the publicwith*()methods makes checked-exception analysis fail downstream after an upgrade.For example, a consumer has
exceptions.check.missingCheckedExceptionInThrows: trueand a method that doesreturn $mf->withDevice(ipAddress: '1.1.1.1');. PHPStan passes onmain. On this branch it reportsthrows checked exception MaxMind\Exception\InvalidInputException but it's missing from the PHPDoc @throws tag(reproduced). Tell users to declare or catch the exception, or to mark it as unchecked.🤖 Comment by Claude Opus 5.5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consumers that enable checked-exception analysis must catch or declare
InvalidInputException, or configure it as unchecked. Per Greg's guidance, I did not add another changelog entry for the PHPDoc change. The new entries describe the runtime fixes.🤖 Comment by Codex on behalf of Greg.