PHP_CodeSniffer
PHP_CodeSniffer copied to clipboard
Add metrics to the `PSR2.ControlStructures.SwitchDeclaration` sniff
Description
Recreation of upstream PR https://github.com/squizlabs/PHP_CodeSniffer/pull/1542:
I've explicitly not added metrics for:
- lowercase keyword as those are already recorded by the
Generic.PHP.LowerCaseKeyword
sniffbreak
/return
not on a line by itself as that is already recorded by theGeneric.Formatting.DisallowMultipleStatements
sniffResolves squizlabs/PHP_CodeSniffer#1541
Please let me know if there is anything you'd like me to change (phrasing and such).
Suggested changelog entry
PSR2/SwitchDeclaration: the sniff can now provide some metric on space usage in switch
structures for a code base.