While reviewing PHPCSExtra's Universal sniffs, a few of our internal sniffs duplicate functionality that Universal already provides. Since PHPCSExtra is already in installed_paths, we can drop the internal implementations and reference the Universal sniffs directly in PhpCollective/ruleset.xml.
Direct replacements
| Internal sniff |
Universal replacement |
PhpCollective.ControlStructures.DisallowAlternativeControlStructures (Sniffs/ControlStructures/DisallowAlternativeControlStructuresSniff.php) |
Universal.ControlStructures.DisallowAlternativeSyntax |
PhpCollective.WhiteSpace.CommaSpacing (Sniffs/WhiteSpace/CommaSpacingSniff.php) |
Universal.WhiteSpace.CommaSpacing |
Not direct replacements (keep internal)
ElseIfDeclarationSniff — Universal's IfElseDeclaration checks brace/newline placement, not merging else if into elseif. PSR2 already handles that.
ArrayBracketSpacingSniff, ConcatenationSpacingSniff, DisallowTrailingCommaInSingleLineSniff, DisallowShorthandNullableTypeHintSniff, DocBlock*, SingleQuoteSniff, ShortCastSniff, NotEqualSniff, ConditionalExpressionOrderSniff, DisallowCloakingCheckSniff, UseWithAliasingSniff, FunctionNamespaceSniff — no Universal counterpart.
While reviewing PHPCSExtra's Universal sniffs, a few of our internal sniffs duplicate functionality that Universal already provides. Since PHPCSExtra is already in
installed_paths, we can drop the internal implementations and reference the Universal sniffs directly inPhpCollective/ruleset.xml.Direct replacements
PhpCollective.ControlStructures.DisallowAlternativeControlStructures(Sniffs/ControlStructures/DisallowAlternativeControlStructuresSniff.php)Universal.ControlStructures.DisallowAlternativeSyntaxPhpCollective.WhiteSpace.CommaSpacing(Sniffs/WhiteSpace/CommaSpacingSniff.php)Universal.WhiteSpace.CommaSpacingNot direct replacements (keep internal)
ElseIfDeclarationSniff— Universal'sIfElseDeclarationchecks brace/newline placement, not mergingelse ifintoelseif. PSR2 already handles that.ArrayBracketSpacingSniff,ConcatenationSpacingSniff,DisallowTrailingCommaInSingleLineSniff,DisallowShorthandNullableTypeHintSniff,DocBlock*,SingleQuoteSniff,ShortCastSniff,NotEqualSniff,ConditionalExpressionOrderSniff,DisallowCloakingCheckSniff,UseWithAliasingSniff,FunctionNamespaceSniff— no Universal counterpart.