1 <?xml version="1.0" encoding="UTF-8"?>
2 <ruleset name="PPW Coding Standard">
3 <description>This is the coding standard used for the Emogrifier code.
4 This standard has been tested with to work with PHP_CodeSniffer >= 2.3.0.
7 <!--The complete PSR-2 ruleset-->
11 <rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
12 <rule ref="Squiz.Arrays.ArrayBracketSpacing"/>
15 <rule ref="Generic.Classes.DuplicateClassName"/>
16 <rule ref="Squiz.Classes.ClassFileName"/>
17 <rule ref="Squiz.Classes.DuplicateProperty"/>
18 <rule ref="Squiz.Classes.LowercaseClassKeywords"/>
19 <rule ref="Squiz.Classes.SelfMemberReference"/>
21 <!-- Code analysis -->
22 <rule ref="Generic.CodeAnalysis.EmptyStatement"/>
23 <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop"/>
24 <rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall"/>
25 <rule ref="Generic.CodeAnalysis.JumbledIncrementer"/>
26 <rule ref="Generic.CodeAnalysis.UnconditionalIfStatement"/>
27 <rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
28 <rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
29 <rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
32 <rule ref="Generic.Commenting.Fixme"/>
33 <rule ref="Generic.Commenting.Todo"/>
34 <rule ref="PEAR.Commenting.InlineComment"/>
35 <rule ref="Squiz.Commenting.DocCommentAlignment"/>
36 <rule ref="Squiz.Commenting.EmptyCatchComment"/>
37 <rule ref="Squiz.Commenting.FunctionCommentThrowTag"/>
38 <rule ref="Squiz.Commenting.PostStatementComment"/>
39 <rule ref="TYPO3SniffPool.Commenting.ClassComment"/>
40 <rule ref="TYPO3SniffPool.Commenting.DoubleSlashCommentsInNewLine"/>
41 <rule ref="TYPO3SniffPool.Commenting.SpaceAfterDoubleSlash"/>
43 <!-- Control structures -->
44 <rule ref="PEAR.ControlStructures.ControlSignature"/>
45 <rule ref="TYPO3SniffPool.ControlStructures.DisallowEachInLoopCondition"/>
46 <rule ref="TYPO3SniffPool.ControlStructures.DisallowElseIfConstruct"/>
47 <rule ref="TYPO3SniffPool.ControlStructures.ExtraBracesByAssignmentInLoop"/>
48 <rule ref="TYPO3SniffPool.ControlStructures.SwitchDeclaration"/>
49 <rule ref="TYPO3SniffPool.ControlStructures.TernaryConditionalOperator"/>
50 <rule ref="TYPO3SniffPool.ControlStructures.UnusedVariableInForEachLoop"/>
53 <rule ref="Generic.Debug.ClosureLinter"/>
54 <rule ref="TYPO3SniffPool.Debug.DebugCode"/>
57 <rule ref="Generic.Files.OneClassPerFile"/>
58 <rule ref="Generic.Files.OneInterfacePerFile"/>
59 <rule ref="TYPO3SniffPool.Files.FileExtension"/>
60 <rule ref="TYPO3SniffPool.Files.Filename"/>
61 <rule ref="TYPO3SniffPool.Files.IncludingFile"/>
62 <rule ref="Zend.Files.ClosingTag"/>
65 <rule ref="Generic.Formatting.SpaceAfterCast"/>
66 <rule ref="PEAR.Formatting.MultiLineAssignment"/>
69 <rule ref="Generic.Functions.CallTimePassByReference"/>
70 <rule ref="Squiz.Functions.FunctionDuplicateArgument"/>
71 <rule ref="Squiz.Functions.GlobalFunction"/>
74 <!-- Enable this rule when the cyclomatic complexity of all methods is sufficiently low. -->
75 <!--<rule ref="Generic.Metrics.CyclomaticComplexity"/>-->
76 <rule ref="Generic.Metrics.NestingLevel"/>
78 <!-- Naming conventions -->
79 <rule ref="Generic.NamingConventions.ConstructorName"/>
80 <rule ref="PEAR.NamingConventions.ValidClassName"/>
81 <rule ref="TYPO3SniffPool.NamingConventions.ValidFunctionName"/>
82 <rule ref="TYPO3SniffPool.NamingConventions.ValidVariableName"/>
85 <rule ref="Squiz.Objects.ObjectMemberComma"/>
88 <rule ref="Squiz.Operators.IncrementDecrementUsage"/>
89 <rule ref="Squiz.Operators.ValidLogicalOperators"/>
92 <rule ref="Generic.PHP.CharacterBeforePHPOpeningTag"/>
93 <rule ref="Generic.PHP.DeprecatedFunctions"/>
94 <rule ref="Generic.PHP.DisallowShortOpenTag"/>
95 <rule ref="Generic.PHP.ForbiddenFunctions"/>
96 <rule ref="Generic.PHP.NoSilencedErrors"/>
97 <rule ref="Squiz.PHP.CommentedOutCode">
99 <property name="maxPercentage" value="70"/>
102 <rule ref="Squiz.PHP.DisallowMultipleAssignments"/>
103 <rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>
104 <rule ref="Squiz.PHP.DiscouragedFunctions"/>
105 <rule ref="Squiz.PHP.Eval"/>
106 <rule ref="Squiz.PHP.ForbiddenFunctions"/>
107 <rule ref="Squiz.PHP.GlobalKeyword"/>
108 <rule ref="Squiz.PHP.Heredoc"/>
109 <rule ref="Squiz.PHP.InnerFunctions"/>
110 <rule ref="Squiz.PHP.LowercasePHPFunctions"/>
111 <rule ref="Squiz.PHP.NonExecutableCode"/>
114 <rule ref="Squiz.Scope.MemberVarScope"/>
115 <rule ref="Squiz.Scope.StaticThisUsage"/>
116 <rule ref="TYPO3SniffPool.Scope.AlwaysReturn">
117 <exclude-pattern>*/Tests/*</exclude-pattern>
121 <rule ref="Squiz.Strings.DoubleQuoteUsage"/>
122 <rule ref="TYPO3SniffPool.Strings.ConcatenationSpacing"/>
123 <rule ref="TYPO3SniffPool.Strings.UnnecessaryStringConcat"/>
126 <rule ref="PEAR.WhiteSpace.ObjectOperatorIndent"/>
127 <rule ref="PEAR.WhiteSpace.ScopeClosingBrace"/>
128 <rule ref="Squiz.WhiteSpace.CastSpacing"/>
129 <rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
130 <rule ref="Squiz.WhiteSpace.OperatorSpacing"/>
131 <rule ref="Squiz.WhiteSpace.PropertyLabelSpacing"/>
132 <rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
133 <rule ref="TYPO3SniffPool.WhiteSpace.NoWhitespaceAtInDecrement"/>
134 <rule ref="TYPO3SniffPool.WhiteSpace.ScopeClosingBrace"/>
135 <rule ref="TYPO3SniffPool.WhiteSpace.WhitespaceAfterCommentSigns"/>