2011-08-28 16:33:55 +02:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
<!DOCTYPE ruleset SYSTEM "ruleset.dtd">
|
|
|
|
|
<ruleset name="Dolibarr">
|
|
|
|
|
<description>Dolibarr coding standard.</description>
|
2020-02-21 17:31:37 +01:00
|
|
|
<arg name="tab-width" value="4"/>
|
2011-08-28 16:33:55 +02:00
|
|
|
|
2015-12-11 05:08:32 +01:00
|
|
|
<exclude-pattern type="relative">build/html</exclude-pattern>
|
2018-08-09 10:49:17 +02:00
|
|
|
<exclude-pattern type="relative">build/aps</exclude-pattern>
|
2019-08-21 14:59:48 +02:00
|
|
|
<exclude-pattern type="relative">dev/namespacemig</exclude-pattern>
|
2020-01-15 14:25:16 +01:00
|
|
|
<exclude-pattern type="relative">dev/initdata/dbf/includes</exclude-pattern>
|
2015-12-11 05:08:32 +01:00
|
|
|
<exclude-pattern type="relative">documents</exclude-pattern>
|
2019-08-14 23:33:06 +02:00
|
|
|
<exclude-pattern type="relative">htdocs/core/class/lessc.class.php</exclude-pattern>
|
2015-12-11 05:08:32 +01:00
|
|
|
<exclude-pattern type="relative">htdocs/custom</exclude-pattern>
|
|
|
|
|
<exclude-pattern type="relative">htdocs/includes</exclude-pattern>
|
2019-04-03 18:10:10 +02:00
|
|
|
<exclude-pattern type="relative">htdocs/install/doctemplates/websites</exclude-pattern>
|
2015-12-11 05:08:32 +01:00
|
|
|
<exclude-pattern type="relative">htdocs/conf.php</exclude-pattern>
|
|
|
|
|
<exclude-pattern type="relative">*/nltechno*</exclude-pattern>
|
2016-10-29 21:47:10 +02:00
|
|
|
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
2019-04-03 18:10:10 +02:00
|
|
|
<exclude-pattern type="relative">*/htdocs/includes</exclude-pattern>
|
2014-12-19 19:01:29 +01:00
|
|
|
|
2019-03-02 10:00:51 +01:00
|
|
|
<!-- List of all tests -->
|
2011-08-28 16:33:55 +02:00
|
|
|
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2014-07-26 15:07:30 +02:00
|
|
|
<!-- Rules from Internal Standard -->
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2013-09-10 11:50:18 +02:00
|
|
|
<rule ref="Internal.NoCodeFound">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2014-07-26 15:07:30 +02:00
|
|
|
<!-- Rules from Generic Standard -->
|
2014-12-19 19:01:29 +01:00
|
|
|
|
2018-08-09 10:49:17 +02:00
|
|
|
<rule ref="Generic.CodeAnalysis.EmptyStatement">
|
|
|
|
|
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedIf"/>
|
|
|
|
|
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElse"/>
|
|
|
|
|
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedElseif"/>
|
|
|
|
|
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/>
|
|
|
|
|
<exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedForeach"/>
|
|
|
|
|
</rule>
|
2011-09-20 18:07:36 +02:00
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<!-- <rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" /> -->
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall" />
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.JumbledIncrementer" />
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement" />
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier" />
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter" />
|
2011-09-24 16:19:24 +02:00
|
|
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.Found">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2019-01-20 13:22:56 +01:00
|
|
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2019-01-20 14:25:26 +01:00
|
|
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2019-01-20 13:22:56 +01:00
|
|
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2019-01-27 14:10:35 +01:00
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
|
2012-01-16 12:50:55 +01:00
|
|
|
<!--
|
2011-08-28 16:33:55 +02:00
|
|
|
<rule ref="Generic.Commenting.Todo" />
|
2012-01-16 12:50:55 +01:00
|
|
|
-->
|
2011-08-28 16:33:55 +02:00
|
|
|
|
|
|
|
|
<!-- Warning if action on same line than if -->
|
|
|
|
|
<!--
|
|
|
|
|
<rule ref="Generic.ControlStructures.InlineControlStructure">
|
2019-05-23 14:25:16 +02:00
|
|
|
<properties>
|
|
|
|
|
<property name="error" value="false"/>
|
|
|
|
|
</properties>
|
2011-08-28 16:33:55 +02:00
|
|
|
</rule>
|
|
|
|
|
-->
|
|
|
|
|
|
2019-05-23 14:25:16 +02:00
|
|
|
|
2014-07-06 16:43:16 +02:00
|
|
|
<!-- PHP code MUST use only UTF-8 without BOM. -->
|
|
|
|
|
<rule ref="Generic.Files.ByteOrderMark"/>
|
|
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<!-- Lines can be 85 chars long, but never show errors -->
|
|
|
|
|
<rule ref="Generic.Files.LineLength">
|
|
|
|
|
<properties>
|
2018-05-27 17:31:57 +02:00
|
|
|
<property name="lineLimit" value="500" />
|
|
|
|
|
<property name="absoluteLineLimit" value="0" />
|
2011-08-28 16:33:55 +02:00
|
|
|
</properties>
|
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
|
|
<!-- Use Unix newlines -->
|
|
|
|
|
<rule ref="Generic.Files.LineEndings">
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="eolChar" value="\n" />
|
|
|
|
|
</properties>
|
|
|
|
|
</rule>
|
|
|
|
|
|
2019-05-23 14:25:16 +02:00
|
|
|
<!-- Disallow several statements on same line -->
|
|
|
|
|
<!-- We want to allow 'if () { ...small code... }' on same line for better code compacity and readability -->
|
|
|
|
|
<rule ref="Generic.Formatting.DisallowMultipleStatements">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-08-28 16:33:55 +02:00
|
|
|
|
|
|
|
|
<!-- Have 2 chars padding maximum and always show as errors -->
|
|
|
|
|
<!--
|
|
|
|
|
<rule ref="Generic.Formatting.MultipleStatementAlignment">
|
|
|
|
|
<properties> <property name="maxPadding" value="2"/> <property
|
|
|
|
|
name="ignoreMultiLine" value="true"/> </properties> </rule>
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.Formatting.SpaceAfterCast" />
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.Functions.CallTimePassByReference" />
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
|
2019-10-16 20:00:01 +02:00
|
|
|
|
2019-05-23 14:25:16 +02:00
|
|
|
<!-- Disallow several spaces after comma -->
|
|
|
|
|
<!-- We want to allow this because we want to be able to align params on several similare functions on different lines -->
|
|
|
|
|
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma">
|
2012-07-22 14:08:05 +02:00
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-08-28 16:33:55 +02:00
|
|
|
|
|
|
|
|
<!-- Tweaks to metrics -->
|
|
|
|
|
<rule ref="Generic.Metrics.CyclomaticComplexity">
|
|
|
|
|
<properties>
|
2020-04-25 19:13:20 +02:00
|
|
|
<property name="complexity" value="150" />
|
2017-10-06 01:59:26 +02:00
|
|
|
<property name="absoluteComplexity" value="300" />
|
2011-08-28 16:33:55 +02:00
|
|
|
</properties>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="Generic.Metrics.NestingLevel">
|
|
|
|
|
<properties>
|
2017-12-19 18:26:27 +01:00
|
|
|
<property name="nestingLevel" value="12" />
|
2011-08-28 16:33:55 +02:00
|
|
|
<property name="absoluteNestingLevel" value="50" />
|
|
|
|
|
</properties>
|
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.NamingConventions.ConstructorName" />
|
|
|
|
|
<!-- Check if we use PHP4 constructor instead of __construct() -->
|
2018-04-22 18:12:19 +02:00
|
|
|
<rule ref="Generic.NamingConventions.ConstructorName.OldStyle" />
|
2011-08-28 16:33:55 +02:00
|
|
|
|
|
|
|
|
<rule ref="Generic.NamingConventions.UpperCaseConstantName" />
|
|
|
|
|
|
|
|
|
|
<rule ref="Generic.PHP.DeprecatedFunctions" />
|
2012-07-26 09:34:51 +02:00
|
|
|
<rule ref="Generic.PHP.DeprecatedFunctions.Deprecated">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2014-07-08 00:19:00 +02:00
|
|
|
<rule ref="Generic.PHP.DisallowShortOpenTag" />
|
2011-08-28 16:33:55 +02:00
|
|
|
|
|
|
|
|
<rule ref="Generic.PHP.ForbiddenFunctions" />
|
|
|
|
|
|
|
|
|
|
<!-- Warning when using @ before functions -->
|
2019-05-23 14:25:16 +02:00
|
|
|
<!-- We want this. Some features need this -->
|
|
|
|
|
<rule ref="Generic.PHP.NoSilencedErrors">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-08-28 16:33:55 +02:00
|
|
|
|
2018-04-22 18:12:19 +02:00
|
|
|
<!-- Say if null, true, false must be uppercase (Rule 2.5 of PSR2 https://www.php-fig.org/psr/psr-2/) -->
|
|
|
|
|
<rule ref="Generic.PHP.LowerCaseConstant" />
|
2011-08-28 16:33:55 +02:00
|
|
|
|
|
|
|
|
<rule ref="Generic.Strings.UnnecessaryStringConcat" />
|
|
|
|
|
|
2012-07-25 11:29:45 +02:00
|
|
|
<rule ref="Generic.Strings.UnnecessaryStringConcat.Found">
|
|
|
|
|
</rule>
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<!-- Disallow usage of tab -->
|
|
|
|
|
<!-- <rule ref="Generic.WhiteSpace.DisallowTabIndent" /> -->
|
|
|
|
|
|
2019-02-10 12:59:09 +01:00
|
|
|
<!-- Check indent are done with spaces and with correct number -->
|
2011-08-28 16:33:55 +02:00
|
|
|
<!-- Disabled as this does not support tab -->
|
|
|
|
|
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
|
2019-10-27 17:01:23 +01:00
|
|
|
|
2019-05-23 13:12:04 +02:00
|
|
|
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="indent" value="4"/>
|
|
|
|
|
<property name="tabIndent" value="true"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</rule>
|
2019-10-27 17:01:23 +01:00
|
|
|
|
2019-10-16 20:00:01 +02:00
|
|
|
|
2019-02-03 14:29:45 +01:00
|
|
|
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
|
|
|
|
|
|
2018-07-26 17:33:36 +02:00
|
|
|
<!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
|
|
|
|
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
|
|
|
|
|
<properties>
|
2019-10-20 16:56:47 +02:00
|
|
|
<property name="ignoreBlankLines" value="false"/>
|
2018-07-26 17:33:36 +02:00
|
|
|
</properties>
|
|
|
|
|
</rule>
|
2018-07-26 18:05:20 +02:00
|
|
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2019-10-16 20:00:01 +02:00
|
|
|
|
|
|
|
|
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen" />
|
2018-10-24 23:04:26 +02:00
|
|
|
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
|
2018-08-21 14:03:02 +02:00
|
|
|
|
2019-02-02 18:25:01 +01:00
|
|
|
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen" />
|
|
|
|
|
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose" />
|
|
|
|
|
|
2018-08-15 14:28:34 +02:00
|
|
|
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
|
2020-04-10 13:04:30 +02:00
|
|
|
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2019-01-27 15:20:16 +01:00
|
|
|
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="equalsSpacing" value="1"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2019-03-01 19:24:06 +01:00
|
|
|
<rule ref="Squiz.Scope.MethodScope.Missing" />
|
2014-07-26 15:07:30 +02:00
|
|
|
|
2015-01-06 17:54:36 +01:00
|
|
|
<!-- Rules from PEAR Standard -->
|
2014-07-26 15:07:30 +02:00
|
|
|
|
2015-01-06 17:54:36 +01:00
|
|
|
<rule ref="PEAR.Classes.ClassDeclaration" />
|
2011-08-28 16:33:55 +02:00
|
|
|
|
|
|
|
|
<!-- Check for duplicate class names -->
|
|
|
|
|
<!-- <rule ref="Generic.Classes.DuplicateClassName" /> -->
|
|
|
|
|
|
|
|
|
|
<rule ref="PEAR.Commenting.ClassComment" />
|
2015-01-06 17:54:36 +01:00
|
|
|
|
2015-02-10 21:49:39 +01:00
|
|
|
<!-- TODO Remove this and fix reported errors -->
|
|
|
|
|
<rule ref="PEAR.Commenting.ClassComment.Missing">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2016-07-07 09:05:13 +02:00
|
|
|
<rule ref="PEAR.Commenting.ClassComment.MissingTag">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2015-01-06 17:54:36 +01:00
|
|
|
|
2015-02-11 14:28:20 +01:00
|
|
|
<rule ref="PEAR.Commenting.ClassComment.MissingAuthorTag">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2015-01-06 17:54:36 +01:00
|
|
|
|
2015-02-11 14:28:20 +01:00
|
|
|
<rule ref="PEAR.Commenting.ClassComment.MissingCategoryTag">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2015-01-06 17:54:36 +01:00
|
|
|
|
2015-02-11 14:28:20 +01:00
|
|
|
<rule ref="PEAR.Commenting.ClassComment.MissingLicenseTag">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2015-01-06 17:54:36 +01:00
|
|
|
|
2015-02-11 14:28:20 +01:00
|
|
|
<rule ref="PEAR.Commenting.ClassComment.MissingLinkTag">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2015-02-11 14:28:20 +01:00
|
|
|
<rule ref="PEAR.Commenting.ClassComment.MissingPackageTag">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2015-01-06 17:54:36 +01:00
|
|
|
|
2018-08-09 10:49:17 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--
|
2015-02-10 21:49:39 +01:00
|
|
|
<rule ref="PEAR.Commenting.FileComment" />
|
|
|
|
|
<rule ref="PEAR.Commenting.FileComment.WrongStyle">
|
2014-12-18 23:55:07 +01:00
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2015-02-10 21:49:39 +01:00
|
|
|
<rule ref="PEAR.Commenting.FileComment.MissingVersion">
|
2014-12-18 23:55:07 +01:00
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2015-02-10 21:49:39 +01:00
|
|
|
<rule ref="PEAR.Commenting.FileComment.MissingTag">
|
2014-12-18 23:55:07 +01:00
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2015-02-10 21:49:39 +01:00
|
|
|
-->
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2015-02-10 21:49:39 +01:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment" />
|
2015-01-06 17:54:36 +01:00
|
|
|
|
2015-02-10 21:49:39 +01:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.Empty">
|
|
|
|
|
<severity>5</severity>
|
2014-12-05 17:38:34 +01:00
|
|
|
</rule>
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2018-08-14 12:23:10 +02:00
|
|
|
<!--<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
|
2014-12-05 17:38:34 +01:00
|
|
|
<severity>0</severity>
|
2018-08-14 12:23:10 +02:00
|
|
|
</rule>-->
|
2018-09-02 18:49:23 +02:00
|
|
|
<!--<rule ref="PEAR.Commenting.FunctionComment.Missing">
|
2014-12-05 19:26:21 +01:00
|
|
|
<severity>0</severity>
|
2018-09-02 18:49:23 +02:00
|
|
|
</rule>-->
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2015-02-10 21:49:39 +01:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
|
|
|
|
|
|
2015-02-11 14:28:20 +01:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2015-02-10 21:49:39 +01:00
|
|
|
|
2015-02-11 14:28:20 +01:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2015-02-10 21:49:39 +01:00
|
|
|
|
|
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName" />
|
2015-01-06 17:54:36 +01:00
|
|
|
|
2014-12-18 23:55:07 +01:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2011-09-10 14:28:00 +02:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.WrongStyle">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingBeforeParamType">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterLongType">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterLongName">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParams">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.ParameterCommentsNotAligned">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-09-21 13:54:41 +02:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.ParameterNamesNotAligned">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-08-28 16:33:55 +02:00
|
|
|
|
|
|
|
|
<rule ref="PEAR.Commenting.InlineComment" />
|
|
|
|
|
|
2019-05-23 14:25:16 +02:00
|
|
|
<!-- Check position of { after a control structure like if (), while (), etc... -->
|
2019-10-16 20:00:01 +02:00
|
|
|
<!--
|
2019-05-23 14:25:16 +02:00
|
|
|
<rule ref="PEAR.ControlStructures.ControlSignature" />
|
|
|
|
|
-->
|
2011-08-28 16:33:55 +02:00
|
|
|
|
|
|
|
|
<!-- <rule ref="PEAR.ControlStructures.MultiLineCondition" /> -->
|
|
|
|
|
|
|
|
|
|
<!-- Test if () are removed for includes -->
|
2018-07-26 11:10:48 +02:00
|
|
|
<rule ref="PEAR.Files.IncludingFile" />
|
2019-05-23 14:25:16 +02:00
|
|
|
|
2018-07-26 11:57:25 +02:00
|
|
|
<!-- Disable some error messages that we do not want. -->
|
2019-05-23 14:25:16 +02:00
|
|
|
|
2018-07-26 11:57:25 +02:00
|
|
|
<rule ref="PEAR.Files.IncludingFile.UseInclude">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2019-05-23 14:25:16 +02:00
|
|
|
<!-- TODO Enable this test. We should use require for include in prior of include when out of if -->
|
2018-07-26 11:57:25 +02:00
|
|
|
<rule ref="PEAR.Files.IncludingFile.UseIncludeOnce">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.Files.IncludingFile.UseRequire">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2019-05-23 14:25:16 +02:00
|
|
|
<!-- TODO Enable this test. We should use require for include in prior of include when out of if -->
|
2018-07-26 11:57:25 +02:00
|
|
|
<rule ref="PEAR.Files.IncludingFile.UseRequireOnce">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-08-28 16:33:55 +02:00
|
|
|
|
|
|
|
|
<rule ref="PEAR.Formatting.MultiLineAssignment" />
|
|
|
|
|
|
|
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature" />
|
|
|
|
|
|
2019-05-23 14:25:16 +02:00
|
|
|
<!-- TODO Enable this test. -->
|
2015-11-25 23:26:31 +01:00
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2019-05-23 14:25:16 +02:00
|
|
|
<!-- TODO Enable this test. -->
|
2015-11-25 23:26:31 +01:00
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2019-10-16 20:00:01 +02:00
|
|
|
|
2015-11-25 23:26:31 +01:00
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2012-08-27 17:55:15 +02:00
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature.Indent">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2014-12-05 20:34:36 +01:00
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeOpenBracket">
|
|
|
|
|
<severity>0</severity>
|
2014-12-05 19:26:21 +01:00
|
|
|
</rule>
|
2014-12-05 20:08:37 +01:00
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<rule ref="PEAR.Functions.ValidDefaultValue" />
|
|
|
|
|
|
|
|
|
|
<rule ref="PEAR.NamingConventions.ValidClassName" />
|
2012-03-18 17:51:40 +01:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidClassName.Invalid">
|
2012-03-18 17:16:46 +01:00
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2013-09-10 12:11:08 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCapital">
|
2011-08-28 19:40:51 +02:00
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2013-09-10 12:11:08 +02:00
|
|
|
<!-- some phpcs have a typo error in rule, so we add it too -->
|
2013-09-10 13:45:39 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCaptial">
|
2013-09-10 12:11:08 +02:00
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName" />
|
2014-08-28 12:31:57 +02:00
|
|
|
|
|
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2012-07-25 12:20:45 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNameInvalid">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2013-09-10 02:32:24 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<!-- some phpcs have a typo error in rule, so we add it too -->
|
2011-09-16 19:57:09 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNoCaptial">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2014-08-28 12:31:57 +02:00
|
|
|
|
2018-08-13 17:26:32 +02:00
|
|
|
<!--<rule ref="PEAR.NamingConventions.ValidFunctionName.NotCamelCaps">
|
2011-08-28 19:40:51 +02:00
|
|
|
<severity>0</severity>
|
2018-08-13 17:26:32 +02:00
|
|
|
</rule>-->
|
2018-08-14 10:21:34 +02:00
|
|
|
<!--<rule ref="PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps">
|
2018-08-09 10:49:17 +02:00
|
|
|
<severity>0</severity>
|
2018-08-14 10:21:34 +02:00
|
|
|
</rule>-->
|
2011-09-16 19:57:09 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore">
|
2011-08-28 19:08:13 +02:00
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-08-28 16:33:55 +02:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidVariableName" />
|
|
|
|
|
|
2018-08-29 22:06:05 +02:00
|
|
|
<rule ref="PSR2.Classes.ClassDeclaration" />
|
2018-08-29 21:25:22 +02:00
|
|
|
<rule ref="PSR2.Methods.FunctionClosingBrace" />
|
2019-01-27 10:49:34 +01:00
|
|
|
<rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed" />
|
2018-08-29 21:25:22 +02:00
|
|
|
|
2015-06-05 15:52:18 +02:00
|
|
|
<!-- This is not in PSR2 -->
|
|
|
|
|
<rule ref="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent" />
|
|
|
|
|
|
2012-01-05 01:06:50 +01:00
|
|
|
<!-- Need to be commented to be disabled
|
2011-12-30 14:32:33 +01:00
|
|
|
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace.Line">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2012-01-05 01:06:50 +01:00
|
|
|
-->
|
2018-08-09 10:49:17 +02:00
|
|
|
|
2011-08-28 16:33:55 +02:00
|
|
|
<!-- Already found as a Generic rule -->
|
|
|
|
|
<!-- <rule ref="PEAR.WhiteSpace.ScopeIndent" /> -->
|
|
|
|
|
|
2014-07-26 15:07:30 +02:00
|
|
|
|
|
|
|
|
<!-- Rules from Zend Standard-->
|
|
|
|
|
|
|
|
|
|
<!-- The closing ?> tag MUST be omitted from files containing only PHP. -->
|
|
|
|
|
<rule ref="Zend.Files.ClosingTag"/>
|
|
|
|
|
|
2019-01-27 14:10:35 +01:00
|
|
|
<rule ref="PSR2.Classes.ClassDeclaration" />
|
|
|
|
|
<rule ref="PSR2.Methods.FunctionClosingBrace" />
|
|
|
|
|
<rule ref="PSR2.Files.EndFileNewline.TooMany" />
|
2019-02-24 20:06:55 +01:00
|
|
|
<rule ref="PSR2.Files.EndFileNewline.NoneFound" />
|
|
|
|
|
<rule ref="PSR2.Methods.FunctionCallSignature.SpaceBeforeOpenBracket" />
|
2019-03-05 22:10:46 +01:00
|
|
|
<rule ref="PSR2.Classes.PropertyDeclaration.VarUsed" />
|
2011-08-28 16:33:55 +02:00
|
|
|
</ruleset>
|