Skip to content
This repository was archived by the owner on Aug 20, 2026. It is now read-only.

Add ignore error rule for env usage outside config directory in PHPStan - #34

Merged
adrianmejias merged 1 commit into
mainfrom
develop
Apr 4, 2026
Merged

Add ignore error rule for env usage outside config directory in PHPStan#34
adrianmejias merged 1 commit into
mainfrom
develop

Conversation

@adrianmejias

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings April 4, 2026 23:26
@adrianmejias adrianmejias self-assigned this Apr 4, 2026
@adrianmejias
adrianmejias merged commit 3e82d53 into main Apr 4, 2026
3 of 4 checks passed
@adrianmejias
adrianmejias deleted the develop branch April 4, 2026 23:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ignoreErrors rule in phpstan.neon.dist to ignore the “Called 'env' outside of the config directory…” error.

Comment thread phpstan.neon.dist
Comment on lines +12 to +13
ignoreErrors:
- "#Called 'env' outside of the config directory which returns null when the config is cached, use 'config'#"

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
ignoreErrors:
- "#Called 'env' outside of the config directory which returns null when the config is cached, use 'config'#"

Copilot uses AI. Check for mistakes.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants