-
Notifications
You must be signed in to change notification settings - Fork 47
Refactor the usage of $properties param to $args to align with WordPress usage
#59
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
Conversation
|
@justlevine, I cherry-picked your branch and continued refactoring. I'm inclined to go with |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk WordPress/abilities-api#59 +/- ##
============================================
- Coverage 84.28% 84.22% -0.07%
Complexity 96 96
============================================
Files 8 8
Lines 509 507 -2
============================================
- Hits 429 427 -2
Misses 80 80
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Semantically, I'm good either way (do you "prepare the args" to be used as class properties or do you "prepare properties" so they can be used?) Only reason I went with But filters don't need to match the semantics for direct class overloading, and they also have a much easier core deprecation path if we want to change the name compared to a |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
$properties param to $arg to align with WordPress usage
$properties param to $arg to align with WordPress usage$properties param to $args to align with WordPress usage
Right, both names are fine here in that context. The filter name doesn't need to follow the method name, so we can be flexible. |
|
I verified the changes in the WP core env (WordPress/wordpress-develop#9410), and applied some small tweaks to ensure CI is green there, too. I also set the version for the plugin and Composer package to |
|
@justlevine or @emdashcodes. It looks like I can no longer merge without approval from someone else. I would appreciate a final check from one of you. |
emdashcodes
left a comment
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.
Just had a chance to look. 👍
In the future, would we be able to use
|
Is it something that could be automated with a GitHub action triggered when a new release is created through GitHub UI? |
|
Yes it is, though if there isn't already FOSSable prior art somewhere, it might not make sense to waste time on a solution for this repo alone over the next six weeks. |
Follow up for:
More details in this #54 (comment). The most relevant part from @justlevine:
This PR refactors the usage of
$propertiesto$argsto reflect the conversation. As part of the refactoring, the definition for ability registration was also updated to remove the optionality of$argsbecause to work correctly, there needs to be at leastability_classpassed, or more frequently, three fields:label,description, andexecute_callback.Entire codebase was slightly refactored to follow the convention agreed upon.