-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Description
Problem
A deprecated syntax is present in ruleset.xml for the property ignoreIndentationTokens under the sniff Generic.WhiteSpace.ScopeIndent. The current approach passes an array of values as a comma-separated string:
<property name="ignoreIndentationTokens" type="array" value="T_CLOSE_TAG"/>Details
- Passing an array of values to a property using a comma-separated string was deprecated in PHP_CodeSniffer 3.3.0.
- Support for this syntax will be removed in PHPCS 4.0.0.
- The correct approach is to pass array values via
<element [key="..." ]value="...">nodes instead.
Reference Warning
DEPRECATED: Passing an array of values to a property using a comma-separated string was deprecated in PHP_CodeSniffer 3.3.0. Support will be removed in PHPCS 4.0.0. The deprecated syntax was used for property "ignoreIndentationTokens" for sniff "Generic.WhiteSpace.ScopeIndent". Pass array values via <element [key="..." ]value="..."> nodes instead.
Suggested Solution
- Refactor the
ruleset.xmlto use the new syntax for array properties. - Example:
<rule ref="Generic.WhiteSpace.ScopeIndent"> <properties> <property name="ignoreIndentationTokens" type="array"> <element value="T_CLOSE_TAG"/> </property> </properties> </rule>
- Review other array properties in the file for similar issues.
Impact
- This change ensures compatibility with upcoming PHPCS versions and prevents future errors.
References:
Metadata
Metadata
Assignees
Labels
No labels