Check that doctrine entities are not final#143
Merged
ondrejmirtes merged 1 commit intophpstan:masterfrom Sep 25, 2020
Merged
Conversation
ondrejmirtes
requested changes
Sep 24, 2020
Member
ondrejmirtes
left a comment
There was a problem hiding this comment.
Yeah, I'm fine with this. Please add it as a bleeding edge rule similar to here: https://github.com/phpstan/phpstan-strict-rules/blob/334898a32217e4605e0f9cfa3d3fc3101bda26be/rules.neon#L67-L69
2b17ca7 to
7cc794d
Compare
Contributor
Author
|
@ondrejmirtes Updated according to your suggestions. Also added a test case. |
Contributor
Author
|
Hmm... there is already a similar pull request: #84 Except I slightly disagree with the statement that entities shouldn't have final methods. I have a case where I'm actually using final method on purpose. But then again I could just disable that particular rule in my codebase. |
ondrejmirtes
requested changes
Sep 24, 2020
Member
ondrejmirtes
left a comment
There was a problem hiding this comment.
I'm fine with the rule in this PR as it is.
d52b474 to
30f2b9e
Compare
Contributor
Author
|
Done. :-) |
30f2b9e to
89c2186
Compare
89c2186 to
cd8bcc9
Compare
Contributor
Author
|
Should be okay now. |
Member
|
Thank you! |
Member
|
Tagged as 0.12.20. |
Contributor
|
@enumag thanks! 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I create all my classes as final by default. This however can cause issues with Doctrine:
What do you think about a rule to avoid final entities?