-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
[2.x] Restructure navigation item class design to use composition over inheritance #1626
Merged
caendesilva
merged 42 commits into
improved-navigation-internals
from
restructure-navigation-item-oop-design
Mar 22, 2024
Merged
[2.x] Restructure navigation item class design to use composition over inheritance #1626
caendesilva
merged 42 commits into
improved-navigation-internals
from
restructure-navigation-item-oop-design
Mar 22, 2024
Conversation
This file contains 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
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## improved-navigation-internals #1626 +/- ##
================================================================
Coverage 99.87% 99.87%
- Complexity 1780 1782 +2
================================================================
Files 184 184
Lines 4811 4815 +4
================================================================
+ Hits 4805 4809 +4
Misses 6 6 ☔ View full report in Codecov by Sentry. |
caendesilva
force-pushed
the
restructure-navigation-item-oop-design
branch
from
March 21, 2024 19:26
9b085b1
to
c67fc32
Compare
This reverts commit 215240d.
I don't see why this is needed on this class
Replaced by NavigationGroupTest.php
caendesilva
force-pushed
the
restructure-navigation-item-oop-design
branch
from
March 21, 2024 20:02
db2fe7a
to
03f6da0
Compare
caendesilva
force-pushed
the
restructure-navigation-item-oop-design
branch
from
March 21, 2024 20:02
03f6da0
to
eff193b
Compare
This reverts commit 9c8ab4e.
This reverts commit ebc687f.
Seems like this is needed to simplify the API between the navigation element classes
This reverts commit 45c217c.
Like this is cool, and it makes the state make more sense when dumped, but it doesn't actually matter. Duck typing works fine here, and I don't think it's worth exposing a public method just for this.
…ion-item-oop-design
…ion-item-oop-design
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.
We have some quirks due to the inheritance so I started wondering if it made the most sense that GroupedNavigationItem extended NavigationItem. For example, the destination is only null for groups, so it makes little sense for the base class to have that. It also adds some conflicts with making the constructors and static create helpers compatible. Additionally, get getRoute and getUrl accessors don't make sense on the group class. Just because both classes can belong as children in a navigation menu I think they are different enough to have separate structures as they're responsibilities and usages are very different.