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

Mark classes as final #1984

Merged
merged 6 commits into from Apr 26, 2019
Merged

Mark classes as final #1984

merged 6 commits into from Apr 26, 2019

Conversation

malarzm
Copy link
Member

@malarzm malarzm commented Mar 21, 2019

Several classes are now marked as final. Some things I was considering:

  • is class marked as internal
  • does it have an interface
  • is there any way one could extend the class and use somehow inject it into ODM again

By the way I've removed two unused mock classes and a test that was testing nothing (interesting) and allowed me to make ClassMetadataFactory final

@alcaeus
Copy link
Member

alcaeus commented Mar 29, 2019

With 1.3.x now being merged down into master, we no longer prepare separate pull requests to prepare deprecations. The course of action in this case would be to create a pull request to 1.3.x that marks the classes in question as @final and throws a deprecation when a class is extended. To do so, you can compare self:class against static::class: https://3v4l.org/jE9Ef.

Once the PR to 1.3.x has been merged and the branch merged into master, this PR can be rebased to drop the @final annotations and make the classes final for good.

@alcaeus
Copy link
Member

alcaeus commented Apr 15, 2019

#2008 was merged into 1.3.x and further on to master, so this can be rebased. @malarzm you can remove changes to phpstan.neon.dist - I had to silence errors related to @final to get it stable: ba0798e#diff-0847156bd64b0de0f4d91da2394ec0e8R11.

@malarzm malarzm force-pushed the mark-classes-final branch 5 times, most recently from 56aaae9 to 5773408 Compare April 17, 2019 18:44
@alcaeus alcaeus added this to To Do in ODM 2.0 via automation Apr 23, 2019
@alcaeus alcaeus added this to 2.0 in Roadmap Apr 23, 2019
@alcaeus alcaeus merged commit 253a16d into doctrine:master Apr 26, 2019
ODM 2.0 automation moved this from To Do to Done Apr 26, 2019
@malarzm malarzm deleted the mark-classes-final branch April 26, 2019 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
ODM 2.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants