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 #1152

Merged
merged 1 commit into from
May 15, 2024
Merged

Mark classes as final #1152

merged 1 commit into from
May 15, 2024

Conversation

AJenbo
Copy link
Member

@AJenbo AJenbo commented May 12, 2024

Type: refactoring
Breaking change: yes

A good article on the subject: https://ocramius.github.io/blog/when-to-declare-classes-final/

Marks classes we do not extend as final. This makes it easier to reason about both for humans and tools. And it lets us know that they are not changed by users allowing us more flexibility when refactoring, since the internals cannot have been manipulated by an extending class. This also slightly lowers coupling as it promotes using interfaces and abstracts when making hints (10 couplings got removed as part of this PR).

All classes marked as final in this PR either cannot be replaced, should not be extended, or is never used as types.

@AJenbo AJenbo added this to the 3.0.0 milestone May 12, 2024
@AJenbo AJenbo marked this pull request as draft May 12, 2024 01:44
Copy link

codecov bot commented May 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.15%. Comparing base (39a9529) to head (9d691d4).

Additional details and impacted files
@@            Coverage Diff            @@
##                3.x    #1152   +/-   ##
=========================================
  Coverage     92.15%   92.15%           
  Complexity     1278     1278           
=========================================
  Files           107      107           
  Lines          3378     3378           
=========================================
  Hits           3113     3113           
  Misses          265      265           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AJenbo AJenbo force-pushed the final-classes branch 3 times, most recently from bd4ac48 to 207daab Compare May 12, 2024 03:08
@AJenbo AJenbo marked this pull request as ready for review May 12, 2024 03:08
@AJenbo AJenbo force-pushed the final-classes branch 5 times, most recently from d22a615 to 69d586e Compare May 14, 2024 16:54
@kylekatarnls kylekatarnls merged commit 63fdbc6 into 3.x May 15, 2024
20 checks passed
@kylekatarnls kylekatarnls deleted the final-classes branch May 15, 2024 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants