Add ignore error rule for env usage outside config directory in PHPStan - #34
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the repository’s PHPStan configuration to suppress a specific Larastan warning about calling env() outside the config/ directory (a pattern that can break when Laravel config is cached).
Changes:
- Add an
ignoreErrorsrule inphpstan.neon.distto ignore the “Called 'env' outside of the config directory…” error.
| ignoreErrors: | ||
| - "#Called 'env' outside of the config directory which returns null when the config is cached, use 'config'#" |
There was a problem hiding this comment.
ignoreErrors here globally suppresses the Larastan/PHPStan warning about calling env() outside the config directory. A repo-wide search shows env( is currently only used inside config/cloudflare-turnstile.php, so this ignore appears unnecessary and will reduce static analysis signal by allowing future env() usage in src/ to slip through unnoticed.
Suggestion: remove this ignore rule, or (if you’re addressing a known false-positive) scope it tightly using an ignoreErrors entry with message + path (and ideally count) so new occurrences still fail CI.
| ignoreErrors: | |
| - "#Called 'env' outside of the config directory which returns null when the config is cached, use 'config'#" |
No description provided.