Skip to content

Use the correct type for final constants#3638

Merged
ondrejmirtes merged 1 commit intophpstan:1.12.xfrom
thg2k:pr/const_final_type
Nov 17, 2024
Merged

Use the correct type for final constants#3638
ondrejmirtes merged 1 commit intophpstan:1.12.xfrom
thg2k:pr/const_final_type

Conversation

@thg2k
Copy link
Copy Markdown
Contributor

@thg2k thg2k commented Nov 16, 2024

Trying to tame the new level 10.. I want to access class constants as $var::CONST, but rightfully so they are of mixed type as they could be overridden...

Accept a @final annotation (or the actual native final for php 8.3) to return the correct type.

@ondrejmirtes ondrejmirtes merged commit 25a06dd into phpstan:1.12.x Nov 17, 2024
@ondrejmirtes
Copy link
Copy Markdown
Member

Thank you.

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