Skip to content

Ignore impure.staticPropertyAccess PHPStan errors #810

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

Merged
merged 2 commits into from
Mar 29, 2025

Conversation

renanbr
Copy link
Contributor

@renanbr renanbr commented Mar 28, 2025

Since PHPStan 2.1.9, static analysis fails if it finds impure static property access in pure method.

Reasoning: Methods flagged as pure in Money class access the static property self::$calculator.

Minimal example: https://phpstan.org/r/683e4ebe-d0c0-44b5-8a2a-93684c878cd0

Note that this PR does NOT fix the issue. Changes are more about to push the CI to the green again.

@frederikbosch frederikbosch merged commit e8b949c into moneyphp:master Mar 29, 2025
13 checks passed
@frederikbosch
Copy link
Member

Great, thanks!

@renanbr renanbr deleted the impure-static-property-access branch March 31, 2025 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants