Skip to content

Inherit @immutable phpdoc#1489

Merged
ondrejmirtes merged 2 commits intophpstan:1.8.xfrom
herndlm:feature-7506
Jul 10, 2022
Merged

Inherit @immutable phpdoc#1489
ondrejmirtes merged 2 commits intophpstan:1.8.xfrom
herndlm:feature-7506

Conversation

@herndlm
Copy link
Copy Markdown
Contributor

@herndlm herndlm commented Jul 1, 2022

@BackEndTea
Copy link
Copy Markdown
Contributor

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

@herndlm
Copy link
Copy Markdown
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
@herndlm herndlm requested a review from ondrejmirtes July 10, 2022 13:41
@ondrejmirtes ondrejmirtes merged commit 6b09429 into phpstan:1.8.x Jul 10, 2022
@ondrejmirtes
Copy link
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

@immutable is not inherrited from extending or implemeting

3 participants