Skip to content
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

Inherit @immutable phpdoc #1489

Merged
merged 2 commits into from Jul 10, 2022
Merged

Inherit @immutable phpdoc #1489

merged 2 commits into from Jul 10, 2022

Conversation

herndlm
Copy link
Contributor

@herndlm herndlm commented Jul 1, 2022

@BackEndTea
Copy link
Contributor

Should this also work for interfaces? E.g. declare @immutable on the interface means all implementations are immutable

@herndlm
Copy link
Contributor Author

herndlm commented Jul 1, 2022

Should this also work for interfaces? E.g. declare @immutable on the interface means all implementations are immutable

I might be missing something, but I think it should be fine because immutable currently only makes all props readonly and interfaces don't have props, right?
Methods are by default considered to be pure AFAIK and therefore they are not considered via immutable yet.

@herndlm herndlm marked this pull request as ready for review July 1, 2022 19:43
src/Reflection/ClassReflection.php Outdated Show resolved Hide resolved
@ondrejmirtes ondrejmirtes merged commit 6b09429 into phpstan:1.8.x Jul 10, 2022
@ondrejmirtes
Copy link
Member

Thank you!

@herndlm herndlm deleted the feature-7506 branch July 10, 2022 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants