-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
Move printing functions related functionality to dedicated PrintingFunctionsTrait
#2250
Conversation
…unctionsTrait` The printing function list is only used by a small set of sniffs, so are better placed in a dedicated trait. The choice for a `trait` over a `class` is due to the `public` property allowing for adding additional functions to the list. Moving both the base function list + the `public` property to the same trait will allow us to encapsulate all the functionality related to the use of this list in one place. The `$printingFunctions` property, containing the base lists, has also been made `private`. Checking whether or not something is a printing function should now be done by calling the `PrintingFunctionsTrait::is_printing_function()` method. Related to 1465
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.
I wanted to leave a comment in the previous PR if these are going to be moved as well, but I kinda had the hunch you already did that 😄
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 checking @dingo-d @GaryJones: What with you both approving, can this be merged ? |
WPCS moved it to a new trait: WordPress/WordPress-Coding-Standards#2250
WPCS moved it to a new trait: WordPress/WordPress-Coding-Standards#2250
WPCS moved it to a new trait: WordPress/WordPress-Coding-Standards#2250
WPCS moved it to a new trait: WordPress/WordPress-Coding-Standards#2250
The printing function list is only used by a small set of sniffs, so are better placed in a dedicated trait.
The choice for a
trait
over aclass
is due to thepublic
property allowing for adding additional functions to the list.Moving both the base function list + the
public
property to the same trait will allow us to encapsulate all the functionality related to the use of this list in one place.The
$printingFunctions
property, containing the base lists, has also been madeprivate
.Checking whether or not something is a printing function should now be done by calling the
PrintingFunctionsTrait::is_printing_function()
method.Related to #1465