PHPCSStandards / PHPCSExtra

A collection of code standards for use with PHP_CodeSniffer
GNU Lesser General Public License v3.0
91 stars 8 forks source link

:sparkles: New `Universal.FunctionDeclarations.NoLongClosures` sniff #240

Closed jrfnl closed 1 year ago

jrfnl commented 1 year ago

New sniff to check for "long" closures and recommend using named functions instead.

The sniff is fully configurable via the following properties:

The error and the warning have their own error codes - ExceedsMaximum and ExceedsRecommended - and can be included/excluded separately from a ruleset.

Includes unit tests. Includes documentation. Includes metrics.

Closes #192