Ignore phpstan errors in fewer files#2709
Conversation
WalkthroughReworks PHPStan ignoreErrors in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Pre-merge checks✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
phpstan.neon (2)
255-278: Good improvement to enforce stricter type safety.Converting global error suppressions to file-specific ones is a solid step toward improving type safety across the codebase. This ensures that new code in other files won't be allowed to return
mixedtypes without proper type declarations.Consider creating a plan to gradually fix the underlying type safety issues in these 21 files to fully eliminate this suppression.
335-335: Remove trailing whitespace.There are extra spaces at the end of this line. While YAML tolerates trailing whitespace, it's cleaner to remove it.
🔎 Proposed fix
- - classes/helpers/FrmAppHelper.php + - classes/helpers/FrmAppHelper.php
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
phpstan.neon
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Cypress
- GitHub Check: PHP 8 tests in WP 6.9
- GitHub Check: PHP 7.4 tests in WP 6.9
🔇 Additional comments (1)
phpstan.neon (1)
341-343: Pattern#array given#is too generic and could suppress multiple unrelated errors.The pattern would match any PHPStan error containing "array given"—for example, "expects string but array given", "expects object but array given", etc. Given FrmFieldsHelper.php has numerous functions with specific array parameter type hints, this single pattern likely suppresses multiple distinct error types.
Make the pattern more specific by including the parameter type expectation, such as
#expects string but array given#, or identify the exact error message(s) by running PHPStan on the file.
…er_files Ignore phpstan errors in fewer files
Bumping the baseline so these rules are enforced in most files.