Sniffs in PHP_CodeSniffer should preferably be accompanied by documentation. There are currently still a number of sniffs which don't have documentation.
Sniff documentation is provided via XML files in the standard's Docs directory and is available to end-users via the command-line and/or can be compiled into an HTML or Markdown file.
To see an example of some of some available documentation, run:
phpcs --standard=PSR12 --generator=Text
Getting started
The CONTRIBUTING doc contains information on writing sniff documentation and guidelines which should be followed.
Action list
Blocked
To Do
Note: a number of sniffs will be removed in v 4.0. Those have been deliberately excluded from the above action list.
Claimed/Work in Progress
Done
Want to contribute ?
Leave a comment below to claim a sniff you'll be working on.
PRs related to this task should preferably only contain the docs for one sniff each.
Sniffs in PHP_CodeSniffer should preferably be accompanied by documentation. There are currently still a number of sniffs which don't have documentation.
Sniff documentation is provided via XML files in the standard's
Docsdirectory and is available to end-users via the command-line and/or can be compiled into an HTML or Markdown file.To see an example of some of some available documentation, run:
Getting started
The CONTRIBUTING doc contains information on writing sniff documentation and guidelines which should be followed.
Action list
Blocked
PSR12.Files.DeclareStatement(There is a first draft available created by @dingo-d, which can be iterated on [Documentation] PSR12 - Declare Statement #187)Note: this one is blocked until the sniff rewrite has been finished & merged.
To Do
Generic.VersionControl.GitMergeConflictPSR12.Classes.AnonClassDeclaration(There is a first draft available created by @dingo-d, which can be iterated on [Documentation] PSR12 - Anonymous Class Declaration #167)PSR12.Files.FileHeader(There is a first draft available created by @dingo-d, which can be iterated on [Documentation] PSR12 - File Header #231)PSR12.Traits.UseDeclaration(There is a first draft available created by @dingo-d, which can be iterated on [Documentation] PSR12 - Use Declaration #239)Squiz.Commenting.ClassCommentSquiz.Commenting.ClosingDeclarationCommentSquiz.Commenting.EmptyCatchCommentSquiz.Commenting.FileCommentSquiz.Commenting.FunctionCommentSquiz.Commenting.InlineCommentSquiz.Commenting.LongConditionClosingCommentSquiz.Commenting.PostStatementCommentSquiz.Commenting.VariableCommentSquiz.ControlStructures.ControlSignatureSquiz.ControlStructures.ElseIfDeclarationSquiz.ControlStructures.InlineIfDeclarationSquiz.ControlStructures.SwitchDeclarationSquiz.Files.FileExtensionSquiz.Formatting.OperatorBracketSquiz.Functions.FunctionDeclarationArgumentSpacingSquiz.Functions.FunctionDuplicateArgumentSquiz.Functions.FunctionDeclarationSquiz.Functions.GlobalFunctionSquiz.Functions.MultiLineFunctionDeclarationSquiz.NamingConventions.ValidFunctionNameSquiz.NamingConventions.ValidVariableNameSquiz.Objects.ObjectInstantiationSquiz.Operators.ComparisonOperatorUsageSquiz.Operators.IncrementDecrementUsageSquiz.Operators.ValidLogicalOperatorsSquiz.PHP.CommentedOutCodeSquiz.PHP.DisallowBooleanStatementSquiz.PHP.DisallowComparisonAssignmentSquiz.PHP.DisallowInlineIfSquiz.PHP.DisallowMultipleAssignmentsSquiz.PHP.DisallowSizeFunctionsInLoopsSquiz.PHP.DiscouragedFunctionsSquiz.PHP.EmbeddedPhpSquiz.PHP.EvalSquiz.PHP.GlobalKeywordSquiz.PHP.InnerFunctionsSquiz.PHP.LowercasePHPFunctionsSquiz.PHP.NonExecutableCodeSquiz.Scope.MemberVarScopeSquiz.Scope.MethodScopeSquiz.Strings.ConcatenationSpacingSquiz.Strings.DoubleQuoteUsageNote: a number of sniffs will be removed in v 4.0. Those have been deliberately excluded from the above action list.
Claimed/Work in Progress
Squiz.Classes.ClassDeclaration- @braindawg [Docs] Add XML doc for Squiz.Classes.ClassDeclaration sniff #844Squiz.WhiteSpace.ControlStructureSpacing- @jaymcpSquiz.WhiteSpace.FunctionSpacing- @jaymcp [Documentation] Squiz: Function Spacing #451Squiz.WhiteSpace.LogicalOperatorSpacing- @jaymcpSquiz.WhiteSpace.OperatorSpacing- @jaymcpDone
Generic.Arrays.ArrayIndent- @rodrigoprimo Generic/ArrayIndent: add XML documentation #432Generic.CodeAnalysis.EmptyPHPStatement- @rodrigoprimo Generic/EmptyPHPStatement: add XML documentation #166Generic.Commenting.DocComment- @rodrigoprimo Generic/DocComment: add XML documentation #247Generic.Formatting.SpaceBeforeCast- @rodrigoprimo Add documentation for the SpaceBeforeCast sniff #159Generic.PHP.RequireStrictTypes- @rodrigoprimo Generic/RequireStrictTypes: add XML documentation #236Generic.PHP.Syntax- @rodrigoprimo Generic/PHP/Syntax: add XML documentation #175Generic.WhiteSpace.IncrementDecrementSpacing- @rodrigoprimo Generic/IncrementDecrementSpacing: add XML documentation #287Generic.WhiteSpace.LanguageConstructSpacing- @rodrigoprimo Generic/LanguageConstructSpacing: add XML documentation #177PSR12.Classes.ClosingBrace- @dingo-d [Documentation] PSR12 - Closing Brace #170PSR12.Classes.OpeningBraceSpace- @dingo-d [Documentation] PSR12 - Opening Brace Space #171PSR12.ControlStructures.BooleanOperatorPlacement- @dingo-d [Documentation] PSR12 - Boolean Operator Placement #181PSR12.ControlStructures.ControlStructureSpacing- @dingo-d [Documentation] PSR12 - Control Structure Spacing #182PSR12.Files.ImportStatement- @dingo-d [Documentation] PSR12 - Import Statement #232PSR12.Files.OpenTag- @dingo-d [Documentation] PSR12 - Open Tag #233PSR12.Functions.ReturnTypeDeclaration- @dingo-d [Documentation] PSR12 - Return Type Declaration #237PSR12.Properties.ConstantVisibility- @dingo-d [Documentation] PSR12 - Constant Visiblity #238Squiz.Commenting.BlockComment- @costdev [Docs] Add XML doc for Squiz.Commenting.BlockComment sniff #848Squiz.Classes.ClassFileName- @braindawg [Docs] Add XML doc for Squiz.Classes.ClassFileName sniff #843Squiz.Classes.ValidClassName- @braindawg [Docs] Add XML doc for Squiz.Classes.ValidClassName sniff #842Squiz.PHP.Heredoc- @jrfnl Squiz/Heredoc: add XML doc #634Squiz.WhiteSpace.FunctionClosingBraceSpace- @przemekhernik [Documentation] Squiz.WhiteSpace.FunctionClosingBraceSpace #408Squiz.WhiteSpace.MemberVarSpacing- @jaymcp [Documentation] Squiz: Member Var Spacing #373Squiz.WhiteSpace.ScopeClosingBrace- @jaymcp [Documentation] Squiz: Scope Closing Brace #353Squiz.WhiteSpace.SuperfluousWhitespace- @jaymcp [Documentation] Squiz: Superfluous Whitespace #352Want to contribute ?
Leave a comment below to claim a sniff you'll be working on.
PRs related to this task should preferably only contain the docs for one sniff each.