@@ -48,184 +48,20 @@ Later more additional rules can be added. See *phpcs.example.xml*.
4848
4949## Included sniffs  
5050
51+ See [ SniffList] ( SniffsList.md ) <br >
5152There is no really good documentation for sniffs. I wrote one sentence explanation for each used sniff into XML files.
5253
53- ### Generic (34 sniffs)  
54-  -  Generic.Arrays.ArrayIndent
55-  -  Generic.Arrays.DisallowLongArraySyntax
56-  -  Generic.Classes.DuplicateClassName
57-  -  Generic.CodeAnalysis.AssignmentInCondition
58-  -  Generic.CodeAnalysis.EmptyStatement
59-  -  Generic.CodeAnalysis.ForLoopShouldBeWhileLoop
60-  -  Generic.CodeAnalysis.UnconditionalIfStatement
61-  -  Generic.CodeAnalysis.UnnecessaryFinalModifier
62-  -  Generic.CodeAnalysis.UselessOverridingMethod
63-  -  Generic.Commenting.DocComment
64-  -  Generic.ControlStructures.InlineControlStructure
65-  -  Generic.Files.ByteOrderMark
66-  -  Generic.Files.LineEndings
67-  -  Generic.Files.LineLength
68-  -  Generic.Formatting.DisallowMultipleStatements
69-  -  Generic.Formatting.NoSpaceAfterCast
70-  -  Generic.Functions.FunctionCallArgumentSpacing
71-  -  Generic.NamingConventions.UpperCaseConstantName
72-  -  Generic.PHP.CharacterBeforePHPOpeningTag
73-  -  Generic.PHP.DeprecatedFunctions
74-  -  Generic.PHP.DisallowAlternativePHPTags
75-  -  Generic.PHP.DisallowShortOpenTag
76-  -  Generic.PHP.ForbiddenFunctions
77-  -  Generic.PHP.LowerCaseConstant
78-  -  Generic.PHP.LowerCaseKeyword
79-  -  Generic.PHP.LowerCaseType
80-  -  Generic.PHP.NoSilencedErrors
81-  -  Generic.Strings.UnnecessaryStringConcat
82-  -  Generic.WhiteSpace.ArbitraryParenthesesSpacing
83-  -  Generic.WhiteSpace.DisallowSpaceIndent - * Depends on selected indentation configuration* 
84-  -  Generic.WhiteSpace.DisallowTabIndent - * Depends on selected indentation configuration* 
85-  -  Generic.WhiteSpace.IncrementDecrementSpacing
86-  -  Generic.WhiteSpace.LanguageConstructSpacing
87-  -  Generic.WhiteSpace.ScopeIndent
88-  -  Generic.WhiteSpace.SpreadOperatorSpacingAfter
89- 
90- ### PEAR (4 sniffs)  
91-  -  PEAR.Commenting.FunctionComment
92-  -  PEAR.Commenting.InlineComment
93-  -  PEAR.Functions.ValidDefaultValue
94-  -  PEAR.WhiteSpace.ObjectOperatorIndent
95- 
96- ### PSR1 (3 sniffs)  
97-  -  PSR1.Classes.ClassDeclaration
98-  -  PSR1.Files.SideEffects
99-  -  PSR1.Methods.CamelCapsMethodName
100- 
101- ### PSR12 (16 sniffs)  
102-  -  PSR12.Classes.AnonClassDeclaration
103-  -  PSR12.Classes.ClassInstantiation
104-  -  PSR12.Classes.ClosingBrace
105-  -  PSR12.ControlStructures.BooleanOperatorPlacement
106-  -  PSR12.ControlStructures.ControlStructureSpacing
107-  -  PSR12.Files.DeclareStatement
108-  -  PSR12.Files.FileHeader
109-  -  PSR12.Files.ImportStatement
110-  -  PSR12.Files.OpenTag
111-  -  PSR12.Functions.NullableTypeDeclaration
112-  -  PSR12.Functions.ReturnTypeDeclaration
113-  -  PSR12.Keywords.ShortFormTypeKeywords
114-  -  PSR12.Namespaces.CompoundNamespaceDepth
115-  -  PSR12.Operators.OperatorSpacing
116-  -  PSR12.Properties.ConstantVisibility
117-  -  PSR12.Traits.UseDeclaration
118- 
119- ### PSR2 (12 sniffs)  
120-  -  PSR2.Classes.ClassDeclaration
121-  -  PSR2.Classes.PropertyDeclaration
122-  -  PSR2.ControlStructures.ControlStructureSpacing
123-  -  PSR2.ControlStructures.ElseIfDeclaration
124-  -  PSR2.ControlStructures.SwitchDeclaration
125-  -  PSR2.Files.ClosingTag
126-  -  PSR2.Files.EndFileNewline
127-  -  PSR2.Methods.FunctionCallSignature
128-  -  PSR2.Methods.FunctionClosingBrace
129-  -  PSR2.Methods.MethodDeclaration
130-  -  PSR2.Namespaces.NamespaceDeclaration
131-  -  PSR2.Namespaces.UseDeclaration
132- 
133- ### SlevomatCodingStandard (62 sniffs)  
134-  -  SlevomatCodingStandard.Arrays.MultiLineArrayEndBracketPlacement
135-  -  SlevomatCodingStandard.Arrays.TrailingArrayComma
136-  -  SlevomatCodingStandard.Classes.ConstantSpacing
137-  -  SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants
138-  -  SlevomatCodingStandard.Classes.DisallowMultiConstantDefinition
139-  -  SlevomatCodingStandard.Classes.DisallowMultiPropertyDefinition
140-  -  SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces
141-  -  SlevomatCodingStandard.Classes.ModernClassNameReference
142-  -  SlevomatCodingStandard.Classes.ParentCallSpacing
143-  -  SlevomatCodingStandard.Classes.PropertySpacing
144-  -  SlevomatCodingStandard.Classes.RequireMultiLineMethodSignature
145-  -  SlevomatCodingStandard.Classes.RequireSingleLineMethodSignature
146-  -  SlevomatCodingStandard.Classes.TraitUseSpacing
147-  -  SlevomatCodingStandard.Classes.UselessLateStaticBinding
148-  -  SlevomatCodingStandard.Commenting.EmptyComment
149-  -  SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration
150-  -  SlevomatCodingStandard.Commenting.RequireOneLinePropertyDocComment
151-  -  SlevomatCodingStandard.Commenting.UselessFunctionDocComment
152-  -  SlevomatCodingStandard.ControlStructures.EarlyExit
153-  -  SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing
154-  -  SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses
155-  -  SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator
156-  -  SlevomatCodingStandard.Exceptions.DeadCatch
157-  -  SlevomatCodingStandard.Exceptions.ReferenceThrowableOnly
158-  -  SlevomatCodingStandard.Functions.ArrowFunctionDeclaration
159-  -  SlevomatCodingStandard.Functions.DisallowEmptyFunction
160-  -  SlevomatCodingStandard.Functions.StaticClosure
161-  -  SlevomatCodingStandard.Functions.TrailingCommaInCall
162-  -  SlevomatCodingStandard.Functions.UnusedInheritedVariablePassedToClosure
163-  -  SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses
164-  -  SlevomatCodingStandard.Namespaces.DisallowGroupUse
165-  -  SlevomatCodingStandard.Namespaces.FullyQualifiedExceptions
166-  -  SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants
167-  -  SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions
168-  -  SlevomatCodingStandard.Namespaces.NamespaceDeclaration
169-  -  SlevomatCodingStandard.Namespaces.NamespaceSpacing
170-  -  SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly
171-  -  SlevomatCodingStandard.Namespaces.RequireOneNamespaceInFile
172-  -  SlevomatCodingStandard.Namespaces.UnusedUses
173-  -  SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash
174-  -  SlevomatCodingStandard.Namespaces.UseSpacing
175-  -  SlevomatCodingStandard.Namespaces.UselessAlias
176-  -  SlevomatCodingStandard.Numbers.DisallowNumericLiteralSeparator
177-  -  SlevomatCodingStandard.Operators.DisallowEqualOperators
178-  -  SlevomatCodingStandard.Operators.DisallowIncrementAndDecrementOperators
179-  -  SlevomatCodingStandard.Operators.NegationOperatorSpacing
180-  -  SlevomatCodingStandard.PHP.DisallowDirectMagicInvokeCall
181-  -  SlevomatCodingStandard.PHP.OptimizedFunctionsWithoutUnpacking
182-  -  SlevomatCodingStandard.PHP.ShortList
183-  -  SlevomatCodingStandard.PHP.TypeCast
184-  -  SlevomatCodingStandard.TypeHints.DeclareStrictTypes
185-  -  SlevomatCodingStandard.TypeHints.LongTypeHints
186-  -  SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue
187-  -  SlevomatCodingStandard.TypeHints.ParameterTypeHint
188-  -  SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing
189-  -  SlevomatCodingStandard.TypeHints.PropertyTypeHint
190-  -  SlevomatCodingStandard.TypeHints.PropertyTypeHintSpacing
191-  -  SlevomatCodingStandard.TypeHints.ReturnTypeHint
192-  -  SlevomatCodingStandard.TypeHints.UselessConstantTypeHint
193-  -  SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable
194-  -  SlevomatCodingStandard.Variables.UnusedVariable
195-  -  SlevomatCodingStandard.Whitespaces.DuplicateSpaces
196- 
197- ### Squiz (34 sniffs)  
198-  -  Squiz.Arrays.ArrayBracketSpacing
199-  -  Squiz.Arrays.ArrayDeclaration
200-  -  Squiz.Classes.ClassFileName
201-  -  Squiz.Classes.SelfMemberReference
202-  -  Squiz.Classes.ValidClassName
203-  -  Squiz.Commenting.DocCommentAlignment
204-  -  Squiz.Commenting.EmptyCatchComment
205-  -  Squiz.Commenting.FunctionComment
206-  -  Squiz.ControlStructures.ControlSignature
207-  -  Squiz.ControlStructures.ForEachLoopDeclaration
208-  -  Squiz.ControlStructures.ForLoopDeclaration
209-  -  Squiz.ControlStructures.LowercaseDeclaration
210-  -  Squiz.Functions.FunctionDeclaration
211-  -  Squiz.Functions.FunctionDeclarationArgumentSpacing
212-  -  Squiz.Functions.LowercaseFunctionKeywords
213-  -  Squiz.Functions.MultiLineFunctionDeclaration
214-  -  Squiz.Operators.ValidLogicalOperators
215-  -  Squiz.PHP.Eval
216-  -  Squiz.PHP.GlobalKeyword
217-  -  Squiz.PHP.Heredoc
218-  -  Squiz.PHP.InnerFunctions
219-  -  Squiz.PHP.LowercasePHPFunctions
220-  -  Squiz.PHP.NonExecutableCode
221-  -  Squiz.Scope.MethodScope
222-  -  Squiz.Scope.StaticThisUsage
223-  -  Squiz.Strings.DoubleQuoteUsage
224-  -  Squiz.WhiteSpace.CastSpacing
225-  -  Squiz.WhiteSpace.ControlStructureSpacing
226-  -  Squiz.WhiteSpace.FunctionSpacing
227-  -  Squiz.WhiteSpace.ObjectOperatorSpacing
228-  -  Squiz.WhiteSpace.ScopeClosingBrace
229-  -  Squiz.WhiteSpace.ScopeKeywordSpacing
230-  -  Squiz.WhiteSpace.SemicolonSpacing
231-  -  Squiz.WhiteSpace.SuperfluousWhitespace
54+ ### More suggested  
55+ 
56+ #### Check that Namespace matches file structure  
57+ This is used from my own blog in Laravel, where main folder ` app `  is ` BlogApp `  namespace.
58+ 
59+ ``` xml 
60+ <rule  ref =" SlevomatCodingStandard.Files.TypeNameMatchesFileName"  >
61+     <properties >
62+         <property  name =" rootNamespaces"   type =" array"  >
63+             <element  key =" app"   value =" BlogApp"  />
64+         </property >
65+     </properties >
66+ </rule >
67+ ``` 
0 commit comments