Skip to content

Remove undefined constants from scope#1534

Merged
ondrejmirtes merged 1 commit intophpstan:1.8.xfrom
herndlm:remove-undefined-constants
Jul 21, 2022
Merged

Remove undefined constants from scope#1534
ondrejmirtes merged 1 commit intophpstan:1.8.xfrom
herndlm:remove-undefined-constants

Conversation

@herndlm
Copy link
Copy Markdown
Contributor

@herndlm herndlm commented Jul 20, 2022

Constants are currently added to the scope if e.g. defined() is used and passed around, but never removed anymore. Which this PR changes.

The constants are added to the scope via

(Specified)Type-wise this doesn't change anything, but ConstantRule explicitly verifies if a constant is in the scope and not which type it has. And this rule is working a bit better now I think.

@herndlm herndlm force-pushed the remove-undefined-constants branch from 2d99436 to 0502b82 Compare July 20, 2022 20:58
@herndlm herndlm marked this pull request as ready for review July 20, 2022 21:45
@ondrejmirtes ondrejmirtes merged commit 4a5eac1 into phpstan:1.8.x Jul 21, 2022
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you!

@herndlm herndlm deleted the remove-undefined-constants branch July 21, 2022 11:17
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