You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exclude property which is included in the AbstractFunctionRestrictions sniff and by extension in all sniffs which use the abstract, currently expects a comma-delimited list.
This comma-delimited list is then exploded to an array from within the sniff.
In other words, in reality the sniff expects an array.
I would like to propose to change the expected format for the property to array. Code-wise, this is a very minor change, just changing the docblock & the default value.
The documentation in the wiki would also need to be updated.
While this change is significant, it will not cause a BC-break as the merge_custom_array() function which is used for the exploding is already tolerant of array properties which are incorrectly passed as comma-delimited strings.
Having said that, it makes sense to make this change for the WPCS 1.0.0 release,
The upside of making this change will be that users who use WPCS 3.3.0, can start using the new property array format in their custom rulesets which makes for a more easily readable ruleset.
The
exclude
property which is included in theAbstractFunctionRestrictions
sniff and by extension in all sniffs which use the abstract, currently expects a comma-delimited list.This comma-delimited list is then exploded to an array from within the sniff.
In other words, in reality the sniff expects an
array
.I would like to propose to change the expected format for the property to
array
. Code-wise, this is a very minor change, just changing the docblock & the default value.The documentation in the wiki would also need to be updated.
While this change is significant, it will not cause a BC-break as the
merge_custom_array()
function which is used for the exploding is already tolerant ofarray
properties which are incorrectly passed as comma-delimited strings.Having said that, it makes sense to make this change for the WPCS 1.0.0 release,
The upside of making this change will be that users who use WPCS 3.3.0, can start using the new property array format in their custom rulesets which makes for a more easily readable ruleset.
Old format:
New format which would become possible after this change:
Opinions ?
Also: what about removing the support for incorrectly passed
array
properties in WPCS 2.0.0 ?The text was updated successfully, but these errors were encountered: