-
Notifications
You must be signed in to change notification settings - Fork 81
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
Start using WordPressCS 3.1 #171
Merged
Merged
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
Composer: * No need for requiring the Composer PHPCS plugin anymore as it now comes automatically with WPCS and removing the requirement allows WPCS to manage the supported versions, preventing conflicts (and will update to the 1.0.0 version). PHPCS ruleset: * Minor tweak for a replaced sniff as per the changes in WPCS 3.0.0. * Exclude one error code which would conflict with the minimum PHP requirement of this plugin. Refs: * https://github.com/WordPress/WordPress-Coding-Standards/releases/tag/3.0.0 * https://github.com/WordPress/WordPress-Coding-Standards/wiki/Upgrade-Guide-to-WordPressCS-3.0.0-for-ruleset-maintainers
To prevent any BC-breaks, all methods without explicit visibility have now been explicitly declared as `public`. Mind: the `set_up()` and `tear_down()` methods in the tests _should_ be `protected`, but as WP Core didn't always have this correct and this plugin still supports a large range of WP versions, so needs to take a large range of WP versions into account for the WP Core test framework on which the test suite is build, setting the visibility to `public` is the safer choice for now.
To prevent any BC-breaks, all properties without explicit visibility have now been explicitly declared as `public`.
... to prevent code getting really confusing when people would call it using PHP 8.0+ function calls with named arguments.
* Use pre-increment instead of post-increment. * Use `require` for unconditional file includes. * No blank line at end of function.
jrfnl
force-pushed
the
feature/composer-update-for-wpcs-3
branch
from
September 13, 2024 06:10
3d4705b
to
6de1c35
Compare
swissspidy
approved these changes
Oct 1, 2024
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.
Appreciate the detailed changelog.
All sounds very reasonable to me 👍
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.
Composer: update to WordPressCS 3.
Composer:
PHPCS ruleset:
Refs:
CS/QA: all methods should have visibility declared
To prevent any BC-breaks, all methods without explicit visibility have now been explicitly declared as
public
.Mind: the
set_up()
andtear_down()
methods in the tests should beprotected
, but as WP Core didn't always have this correct and this plugin still supports a large range of WP versions, so needs to take a large range of WP versions into account for the WP Core test framework on which the test suite is build, setting the visibility topublic
is the safer choice for now.CS/QA: all properties should have visibility declared
To prevent any BC-breaks, all properties without explicit visibility have now been explicitly declared as
public
.CS: always use parentheses for class instantiation
CS/QA: don't use reserved keywords as parameter names
... to prevent code getting really confusing when people would call it using PHP 8.0+ function calls with named arguments.
Modernize: use the magic DIR constant
CS/QA: miscellaneous other fixes
require
for unconditional file includes.