WordPress-Coding-Standards/WordPress-Extra
jrfnl d8cf58e06d
Extra: add sniff to discourage the use of "long" closures
Loosely related to the discussion in 1486.

This adds a new sniff to the `WordPress-Extra` ruleset to discourage (`warning`) the use of "long" closures.

By default, the sniff will _warn_ when a closure exceeds 5 lines and throw an error when the closure exceeds 8 lines, though these numbers are configurable.
By default, the sniff will only count code lines when determining the closure length and will ignore comment-only and blank lines.

As the intention is to only discourage long closures, the error has been disabled (by setting it to a really high value).

Ref: PHPCSStandards/PHPCSExtra 240

---

👉 To discuss: should the value for the `recommendedLines` property stay at `5` (sniff default) or do we want to use a different value ?
2023-07-20 20:23:16 +02:00
..
ruleset.xml Extra: add sniff to discourage the use of "long" closures 2023-07-20 20:23:16 +02:00