You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
The key has expired.
Added
Universal
🔧 📚 New Universal.CodeAnalysis.NoEchoSprintf sniff to detect use of the inefficient echo [v]sprintf(...); combi and recommends using [v]printf() instead. #242
📊 📚 New Universal.FunctionDeclarations.NoLongClosures sniff to detect "long" closures and recommend using a named function instead. #240
The sniff offers the following properties to influence its behaviour: recommendedLines (defaults to 5), maxLines (defaults to 8), ignoreCommentLines (defaults to true) and ignoreEmptyLines (defaults to true).
🔧 📊 📚 New Universal.FunctionDeclarations.RequireFinalMethodsInTraits sniff to enforce non-private, non-abstract methods in traits to be declared as final. #243, #245
There is a separate NonFinalMagicMethodFound error code for magic methods to allow those to be excluded from the check.
🔧 📊 📚 New Universal.UseStatements.DisallowMixedGroupUse sniff to disallow group use statements which import a combination of namespace/OO construct, functions and/or constants in one statement. #241, #246
Note: the fixer will use a semi-standardized format for group use statements. If there are more specific requirements for the formatting of group use statements, the ruleset configurator should ensure that additional sniffs are included in the ruleset to enforce the required format.
🔧 📊 📚 New Universal.UseStatements.KeywordSpacing sniff to enforce the use of a single space after the use, function, const keywords and both before and after the as keyword in import use statements. #247
The sniff has modular error codes to allow for disabling individual checks.
🔧 📚 New Universal.UseStatements.NoUselessAliases sniff to detect useless aliases (aliasing something to its original name) in import use statements. #244
Note: as OO and function names in PHP are case-insensitive, aliasing to the same name, using a different case is also considered useless.
🔧 📊 📚 New Universal.WhiteSpace.CommaSpacing sniff to enforce that there is no space before a comma and exactly one space, or a new line, after a comma. #254
Additionally, the sniff also enforces that the comma should follow the code and not be placed after a trailing comment.
The sniff has modular error codes to allow for disabling individual checks and checks in certain contexts.
The sniff will respect a potentially set php_version configuration option when deciding how to handle the spacing after a heredoc/nowdoc closer.
Changed
Universal
Minor performance improvements for the Universal.Arrays.DuplicateArrayKey and the Universal.CodeAnalysis.ConstructorDestructorReturn sniffs. #251, #252
Other
Composer: The minimum PHPCSUtils requirement has been updated to ^1.0.8 (was ^1.0.6). #249, #254