mirror of
https://gh.wpcy.net/https://github.com/WordPress/WordPress-Coding-Standards.git
synced 2026-04-23 20:33:18 +08:00
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 ?
|
||
|---|---|---|
| .. | ||
| ruleset.xml | ||