EVOLUTION-NINJA
Edit File: phpcs.xml.dist
<?xml version="1.0"?> <ruleset name="drupal_coder"> <description>The coding standard for coder_sniffer.</description> <file>coder_sniffer</file> <!-- Test files that should not be checked. --> <exclude-pattern>coder_sniffer/*/Test/*\.(inc|css|js|api\.php|tpl\.php)$</exclude-pattern> <exclude-pattern>coder_sniffer/*/Test/*/(good|bad)\.php$</exclude-pattern> <exclude-pattern>coder_sniffer/*/Test/*/src/*\.php$</exclude-pattern> <exclude-pattern>coder_sniffer/*/Test/*/drupal7/*\.php$</exclude-pattern> <exclude-pattern>coder_sniffer/Drupal/Test/good/LongNamespace.php</exclude-pattern> <exclude-pattern>coder_sniffer/Drupal/Test/InfoFiles/trait.php</exclude-pattern> <exclude-pattern>coder_sniffer/DrupalPractice/Test/ProjectDetection/modules</exclude-pattern> <!-- The following comes from the 3.4.2 PHPCS ruleset.xml { --> <!-- Don't hide tokenizer exceptions --> <rule ref="Internal.Tokenizer.Exception"> <type>error</type> </rule> <!-- Include the whole PEAR standard --> <rule ref="PEAR"> <exclude name="PEAR.NamingConventions.ValidFunctionName"/> <exclude name="PEAR.NamingConventions.ValidVariableName"/> <exclude name="PEAR.Commenting.ClassComment"/> <exclude name="PEAR.Commenting.FileComment.MissingCategoryTag"/> <exclude name="PEAR.Commenting.FileComment.MissingPackageTag"/> <exclude name="PEAR.Commenting.FileComment.MissingLinkTag"/> <exclude name="PEAR.Commenting.FileComment.MissingVersion"/> <exclude name="PEAR.Commenting.InlineComment"/> </rule> <!-- Include some sniffs from other standards that don't conflict with PEAR --> <rule ref="Squiz.Arrays.ArrayBracketSpacing"/> <rule ref="Squiz.Arrays.ArrayDeclaration"/> <rule ref="Squiz.Commenting.ClosingDeclarationComment"/> <rule ref="Squiz.ControlStructures.ControlSignature"/> <rule ref="Squiz.ControlStructures.ElseIfDeclaration"/> <rule ref="Squiz.Commenting.BlockComment"/> <rule ref="Squiz.Commenting.DocCommentAlignment"/> <rule ref="Squiz.Commenting.EmptyCatchComment"/> <rule ref="Squiz.Commenting.InlineComment"/> <rule ref="Squiz.Commenting.LongConditionClosingComment"/> <rule ref="Squiz.Commenting.PostStatementComment"/> <rule ref="Squiz.Commenting.VariableComment"/> <rule ref="Squiz.Formatting.OperatorBracket"/> <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"/> <rule ref="Squiz.Operators.ComparisonOperatorUsage"/> <rule ref="Squiz.PHP.DisallowInlineIf"/> <rule ref="Squiz.Scope.MethodScope"/> <rule ref="Squiz.Strings.ConcatenationSpacing"/> <rule ref="Squiz.WhiteSpace.ControlStructureSpacing"/> <rule ref="Squiz.WhiteSpace.FunctionClosingBraceSpace"/> <rule ref="Squiz.WhiteSpace.FunctionSpacing"/> <rule ref="Squiz.WhiteSpace.OperatorSpacing"/> <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace"/> <rule ref="Generic.Arrays.DisallowLongArraySyntax"/> <rule ref="Generic.Commenting.Todo"/> <rule ref="Generic.ControlStructures.InlineControlStructure"/> <rule ref="Generic.Formatting.DisallowMultipleStatements"/> <rule ref="Generic.Formatting.SpaceAfterCast"/> <rule ref="Generic.NamingConventions.ConstructorName"/> <rule ref="Generic.PHP.DeprecatedFunctions"/> <rule ref="Generic.PHP.LowerCaseKeyword"/> <rule ref="Generic.Strings.UnnecessaryStringConcat"/> <rule ref="Generic.WhiteSpace.IncrementDecrementSpacing"/> <rule ref="PSR2.Classes.PropertyDeclaration"/> <rule ref="PSR2.Methods.MethodDeclaration"/> <rule ref="PSR2.Files.EndFileNewline"/> <rule ref="Zend.Files.ClosingTag"/> <!-- PEAR uses warnings for inline control structures, so switch back to errors --> <rule ref="Generic.ControlStructures.InlineControlStructure"> <properties> <property name="error" value="true"/> </properties> </rule> <!-- We use custom indent rules for arrays --> <rule ref="Generic.Arrays.ArrayIndent"/> <rule ref="Squiz.Arrays.ArrayDeclaration.KeyNotAligned"> <severity>0</severity> </rule> <rule ref="Squiz.Arrays.ArrayDeclaration.ValueNotAligned"> <severity>0</severity> </rule> <rule ref="Squiz.Arrays.ArrayDeclaration.CloseBraceNotAligned"> <severity>0</severity> </rule> <rule ref="Squiz.Arrays.ArrayDeclaration.CloseBraceNewLine"> <severity>0</severity> </rule> <!-- Check var names, but we don't want leading underscores for private vars --> <rule ref="Squiz.NamingConventions.ValidVariableName"/> <rule ref="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore"> <severity>0</severity> </rule> <!-- Only one argument per line in multi-line function calls --> <rule ref="PEAR.Functions.FunctionCallSignature"> <properties> <property name="allowMultipleArguments" value="false"/> </properties> </rule> <!-- Have 12 chars padding maximum and always show as errors --> <rule ref="Generic.Formatting.MultipleStatementAlignment"> <properties> <property name="maxPadding" value="12"/> <property name="error" value="true"/> </properties> </rule> <!-- Ban some functions --> <rule ref="Generic.PHP.ForbiddenFunctions"> <properties> <property name="forbiddenFunctions" type="array"> <element key="sizeof" value="count"/> <element key="delete" value="unset"/> <element key="print" value="echo"/> <element key="is_null" value="null"/> <element key="create_function" value="null"/> </property> </properties> </rule> <!-- Private methods MUST not be prefixed with an underscore --> <rule ref="PSR2.Methods.MethodDeclaration.Underscore"> <type>error</type> </rule> <!-- Private properties MUST not be prefixed with an underscore --> <rule ref="PSR2.Classes.PropertyDeclaration.Underscore"> <type>error</type> </rule> <!-- } End of original PHPCS ruleset.xml --> <!-- The following sniffs are disabled because we don't want them --> <rule ref="PEAR.Commenting.FileComment"> <exclude name="PEAR.Commenting.FileComment.MissingAuthorTag"/> <exclude name="PEAR.Commenting.FileComment.MissingLicenseTag"/> </rule> <rule ref="Generic.Files.LineLength"> <exclude name="Generic.Files.LineLength.TooLong"/> </rule> <rule ref="Generic.Commenting.Todo"> <exclude name="Generic.Commenting.Todo.TaskFound"/> <exclude name="Generic.Commenting.Todo.CommentFound"/> </rule> <!-- Not compliant yet, should be fixed in the future. --> <rule ref="PEAR.Commenting.FunctionComment.MissingParamComment"> <exclude-pattern>coder_sniffer/DrupalPractice/Sniffs/CodeAnalysis/VariableAnalysisSniff.php</exclude-pattern> </rule> <rule ref="PEAR.Commenting.FileComment.Missing"> <exclude-pattern>coder_sniffer/Drupal/Test</exclude-pattern> <exclude-pattern>coder_sniffer/DrupalPractice/Test</exclude-pattern> </rule> </ruleset>