squizlabs / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
10.66k stars 1.48k forks source link

PSR2/PSR12/ControlStructureSpacing: don't listen for `T_ELSE` #3872

Closed jrfnl closed 9 months ago

jrfnl commented 1 year ago

Description

No functional changes.

These sniffs only concern themselves with control structures which take parentheses, so listening for T_ELSE is unnecessary as the sniffs will never do anything for that token (they each bow out on no 'parenthesis_opener'/'parenthesis_closer' found).

Suggested changelog entry

N/A (no functional changes)

Types of changes

DannyvdSluijs commented 1 year ago

Since the changes have no effect (as it is a reduction of the tokens it wants to process) the verification is done by confirming the description of this PR is correct and secondly that the code changes are as expected.

jrfnl commented 9 months ago

Closing as replaced by https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/83