-
Notifications
You must be signed in to change notification settings - Fork 15
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
ENH Add sorting by link type #167
ENH Add sorting by link type #167
Conversation
ad747a0
to
84ecd31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like unnecessary added complexity... why not just change the singular and plural names via private static $singular_name
and private static $plural_name
?
Edit: Nevermind, that would violate the acceptance criterion "The Link titles remain unchanged everywhere else." - so this is probably the right way to go about it.
713b256
to
8b2399b
Compare
8b2399b
to
912816c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uasort($typesList, function ($a, $b) { | ||
return $a['priority'] - $b['priority']; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uasort($typesList, function ($a, $b) { | |
return $a['priority'] - $b['priority']; | |
}); | |
uasort($typesList, fn ($a, $b) => $a['priority'] - $b['priority']); |
I won't block merging the PR for this - but in the future we should use the short function syntax for this sort of thing, since we're just returning a value.
The long function syntax is only really valuable when we've got multiple lines of functionality or when the return statement is really long.
Description
Parent issue