Skip to content

Commit 2879cd7

Browse files
committed
Tokens: introduce class constants to replace the static properties
Sniffs should always be able to rely on the token arrays declared as static properties in the `Tokens` to be stable. These token arrays should never be changed/updated by sniffs. However, as they are declared as properties instead of as constants, there is a risk that creative sniff writers will update the token arrays, thereby breaking sniffs from other standards, including PHPCS native sniffs. By changing the token arrays from static properties to class constants, this risk is mitigated. As this is a breaking change which will impact all sniffs, the static properties will remain available during the complete 4.x cycle and will, for now, be _soft_ deprecated. If/when issue 30 has been addressed, this can be changed to a hard deprecation. Fixes 500
1 parent 7055739 commit 2879cd7

File tree

1 file changed

+392
-197
lines changed

1 file changed

+392
-197
lines changed

0 commit comments

Comments
 (0)