2011-08-28 14:33:55 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
<!DOCTYPE ruleset SYSTEM "ruleset.dtd">
|
|
|
|
|
<ruleset name="Dolibarr">
|
|
|
|
|
<description>Dolibarr coding standard.</description>
|
2020-02-21 16:31:37 +00:00
|
|
|
<arg name="tab-width" value="4"/>
|
2024-02-12 02:30:19 +00:00
|
|
|
<arg name="extensions" value="php" />
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2024-02-16 11:59:04 +00:00
|
|
|
<!-- info: '*' is replaced with '.*', so better use '+' in some cases -->
|
|
|
|
|
<!-- info: 'relative' paths are relative to the examined file, so not ok. -->
|
2025-01-05 13:46:26 +00:00
|
|
|
<exclude-pattern>/dev/build/(html|aps)/</exclude-pattern>
|
2024-02-16 11:59:04 +00:00
|
|
|
<exclude-pattern>/dev/tools/test/namespacemig/</exclude-pattern>
|
2024-03-09 15:32:02 +00:00
|
|
|
<exclude-pattern>/dev/tools/phan/stubs/</exclude-pattern>
|
2024-02-16 11:59:04 +00:00
|
|
|
<!-- <exclude-pattern>dev/initdata/dbf/includes</exclude-pattern> -->
|
|
|
|
|
<exclude-pattern>/documents/</exclude-pattern>
|
|
|
|
|
<exclude-pattern>/htdocs/core/class/lessc\.class\.php</exclude-pattern>
|
|
|
|
|
<exclude-pattern>/htdocs/(custom|includes)/</exclude-pattern>
|
|
|
|
|
<exclude-pattern>/htdocs/install/doctemplates/websites</exclude-pattern>
|
|
|
|
|
<exclude-pattern>/htdocs/([^/]+/)?conf\.php</exclude-pattern>
|
|
|
|
|
<exclude-pattern>*/nltechno*</exclude-pattern>
|
|
|
|
|
<exclude-pattern>/source/</exclude-pattern>
|
|
|
|
|
<exclude-pattern>/\.git/</exclude-pattern>
|
|
|
|
|
<exclude-pattern>/\.cache/</exclude-pattern>
|
2014-12-19 18:01:29 +00:00
|
|
|
|
2026-01-15 15:05:06 +00:00
|
|
|
<!-- Custom rules -->
|
|
|
|
|
<config name="installed_paths" value="/dev/setup/codesniffer" />
|
|
|
|
|
<rule ref="codesniffer.Dolibarr.LanguageOfComments"/>
|
|
|
|
|
<rule ref="codesniffer.Dolibarr.CheckIsModEnabledArgument"/>
|
|
|
|
|
|
2019-03-02 09:00:51 +00:00
|
|
|
<!-- List of all tests -->
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2018-08-09 08:49:17 +00:00
|
|
|
|
2014-07-26 13:07:30 +00:00
|
|
|
<!-- Rules from Internal Standard -->
|
2018-08-09 08:49:17 +00:00
|
|
|
|
2020-05-02 11:02:58 +00:00
|
|
|
<rule ref="Internal.NoCodeFound" />
|
2013-09-10 09:50:18 +00:00
|
|
|
|
2014-07-26 13:07:30 +00:00
|
|
|
<!-- Rules from Generic Standard -->
|
2025-09-18 13:41:47 +00:00
|
|
|
<!--
|
|
|
|
|
<rule ref="PSR12.Files.OpenTag">
|
2026-01-15 15:05:06 +00:00
|
|
|
<properties>
|
|
|
|
|
<property name="ignoreIndent" value="true"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</rule>
|
2025-09-18 13:41:47 +00:00
|
|
|
<exclude name="PSR12.WhiteSpace.ScopeIndent"/>
|
2026-01-15 15:05:06 +00:00
|
|
|
-->
|
2020-05-20 22:02:33 +00:00
|
|
|
|
2020-05-02 11:02:58 +00:00
|
|
|
<!-- We want to allow empty statement: It allows to put some code comments into the else for examples -->
|
2018-08-09 08:49:17 +00:00
|
|
|
<rule ref="Generic.CodeAnalysis.EmptyStatement">
|
2024-02-12 02:30:19 +00:00
|
|
|
<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 16:07:36 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="Generic.CodeAnalysis.ForLoopShouldBeWhileLoop" />
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.ForLoopWithTestFunctionCall" />
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="Generic.CodeAnalysis.JumbledIncrementer" />
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="Generic.CodeAnalysis.UnconditionalIfStatement" />
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier" />
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter" />
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.Found">
|
2011-09-24 14:19:24 +00:00
|
|
|
<severity>0</severity>
|
2024-02-12 02:30:19 +00:00
|
|
|
</rule>
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed">
|
2019-01-20 12:22:56 +00:00
|
|
|
<severity>0</severity>
|
2024-02-12 02:30:19 +00:00
|
|
|
</rule>
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed">
|
2019-01-20 13:25:26 +00:00
|
|
|
<severity>0</severity>
|
2024-02-12 02:30:19 +00:00
|
|
|
</rule>
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass">
|
2019-01-20 12:22:56 +00:00
|
|
|
<severity>0</severity>
|
2024-02-12 02:30:19 +00:00
|
|
|
</rule>
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed">
|
2019-01-20 12:22:56 +00:00
|
|
|
<severity>0</severity>
|
2024-02-12 02:30:19 +00:00
|
|
|
</rule>
|
|
|
|
|
<rule ref="Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed">
|
2019-01-20 12:22:56 +00:00
|
|
|
<severity>0</severity>
|
2024-02-12 02:30:19 +00:00
|
|
|
</rule>
|
|
|
|
|
|
2026-01-15 15:05:06 +00:00
|
|
|
<!-- Lower severity on warnings we do not want to show in the pre-commit reports -->
|
|
|
|
|
<rule ref="Generic.Files.LineLength.TooLong">
|
2024-02-12 02:30:19 +00:00
|
|
|
<severity>4</severity>
|
2026-01-15 15:05:06 +00:00
|
|
|
</rule>
|
|
|
|
|
<rule ref="Generic.Metrics.CyclomaticComplexity.TooHigh">
|
2024-02-12 02:30:19 +00:00
|
|
|
<severity>4</severity>
|
2026-01-15 15:05:06 +00:00
|
|
|
</rule>
|
|
|
|
|
<rule ref="Generic.Metrics.NestingLevel.TooHigh">
|
2024-02-12 02:30:19 +00:00
|
|
|
<severity>4</severity>
|
2026-01-15 15:05:06 +00:00
|
|
|
</rule>
|
2019-01-27 13:10:35 +00:00
|
|
|
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- Warnings on TODO -->
|
|
|
|
|
<!-- Disabled: We want to keep TODO as normal
|
|
|
|
|
<rule ref="Generic.Commenting.Todo" />
|
|
|
|
|
-->
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2019-05-23 12:25:16 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- PHP code MUST use only UTF-8 without BOM. -->
|
|
|
|
|
<rule ref="Generic.Files.ByteOrderMark"/>
|
2014-07-06 14:43:16 +00:00
|
|
|
|
2011-08-28 14:33:55 +00:00
|
|
|
<!-- Lines can be 85 chars long, but never show errors -->
|
|
|
|
|
<rule ref="Generic.Files.LineLength">
|
|
|
|
|
<properties>
|
2025-03-25 19:24:14 +00:00
|
|
|
<property name="lineLimit" value="800" />
|
2018-05-27 15:31:57 +00:00
|
|
|
<property name="absoluteLineLimit" value="0" />
|
2011-08-28 14:33:55 +00:00
|
|
|
</properties>
|
|
|
|
|
</rule>
|
|
|
|
|
|
|
|
|
|
<!-- Use Unix newlines -->
|
|
|
|
|
<rule ref="Generic.Files.LineEndings">
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="eolChar" value="\n" />
|
|
|
|
|
</properties>
|
|
|
|
|
</rule>
|
|
|
|
|
|
2020-05-02 13:18:59 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- Disallow several statements on same line -->
|
2020-05-02 13:18:59 +00:00
|
|
|
|
|
|
|
|
<!-- Warning if action on same line than if -->
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- Disabled: We want to allow this for better code compactness and readability
|
|
|
|
|
<rule ref="Generic.ControlStructures.InlineControlStructure">
|
2020-05-02 13:18:59 +00:00
|
|
|
<properties>
|
|
|
|
|
<property name="error" value="false"/>
|
|
|
|
|
</properties>
|
2024-02-12 02:30:19 +00:00
|
|
|
</rule>
|
2020-05-20 22:02:33 +00:00
|
|
|
-->
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- We want to allow 'if () { ...small code... }' on a single line for better code compactness and readability -->
|
2021-03-01 10:26:00 +00:00
|
|
|
<!-- <rule ref="Generic.Formatting.DisallowMultipleStatements">
|
2019-05-23 12:25:16 +00:00
|
|
|
<severity>0</severity>
|
2021-03-01 10:26:00 +00:00
|
|
|
</rule> -->
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2020-05-02 13:18:59 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- Check that assignments have the = aligned on each line. Have 20 chars padding maximum and always show as errors -->
|
2020-05-02 13:18:59 +00:00
|
|
|
<!-- Disabled: Report some false warning
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="Generic.Formatting.MultipleStatementAlignment">
|
2020-05-02 13:18:59 +00:00
|
|
|
<properties>
|
2024-02-12 02:30:19 +00:00
|
|
|
<property name="maxPadding" value="20"/>
|
|
|
|
|
<property name="ignoreMultiLine" value="true"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</rule>
|
2011-08-28 14:33:55 +00:00
|
|
|
-->
|
2020-05-20 22:02:33 +00:00
|
|
|
|
2011-08-28 14:33:55 +00:00
|
|
|
<rule ref="Generic.Formatting.SpaceAfterCast" />
|
|
|
|
|
|
2025-09-17 12:45:02 +00:00
|
|
|
<!-- <rule ref="Generic.Functions.CallTimePassByReference" /> This rule does not exists anymore -->
|
2011-08-28 14:33:55 +00:00
|
|
|
|
|
|
|
|
<rule ref="Generic.Functions.FunctionCallArgumentSpacing" />
|
2019-10-16 18:00:01 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- Disallow several spaces after comma -->
|
2026-05-05 08:57:35 +00:00
|
|
|
<!-- We want to allow this because we want to be able to align params on several similar functions on different lines -->
|
2019-05-23 12:25:16 +00:00
|
|
|
<rule ref="Generic.Functions.FunctionCallArgumentSpacing.TooMuchSpaceAfterComma">
|
2012-07-22 12:08:05 +00:00
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- Tweaks to metrics -->
|
|
|
|
|
<rule ref="Generic.Metrics.CyclomaticComplexity">
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="complexity" value="250" />
|
|
|
|
|
<property name="absoluteComplexity" value="500" />
|
|
|
|
|
</properties>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="Generic.Metrics.NestingLevel">
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="nestingLevel" value="12" />
|
|
|
|
|
<property name="absoluteNestingLevel" value="50" />
|
|
|
|
|
</properties>
|
|
|
|
|
</rule>
|
2011-08-28 14:33:55 +00:00
|
|
|
|
|
|
|
|
<rule ref="Generic.NamingConventions.ConstructorName" />
|
|
|
|
|
<!-- Check if we use PHP4 constructor instead of __construct() -->
|
2018-04-22 16:12:19 +00:00
|
|
|
<rule ref="Generic.NamingConventions.ConstructorName.OldStyle" />
|
2011-08-28 14:33:55 +00:00
|
|
|
|
|
|
|
|
<rule ref="Generic.NamingConventions.UpperCaseConstantName" />
|
|
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="Generic.PHP.DeprecatedFunctions" />
|
|
|
|
|
<rule ref="Generic.PHP.DeprecatedFunctions.Deprecated">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2018-08-09 08:49:17 +00:00
|
|
|
|
2014-07-07 22:19:00 +00:00
|
|
|
<rule ref="Generic.PHP.DisallowShortOpenTag" />
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="Generic.PHP.ForbiddenFunctions" />
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- Disable warning when using @ before functions -->
|
|
|
|
|
<!-- We want the '@' symbols. Some features need this. -->
|
|
|
|
|
<rule ref="Generic.PHP.NoSilencedErrors">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2018-04-22 16:12:19 +00: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 14:33:55 +00:00
|
|
|
|
|
|
|
|
<rule ref="Generic.Strings.UnnecessaryStringConcat" />
|
|
|
|
|
|
2012-07-25 09:29:45 +00:00
|
|
|
<rule ref="Generic.Strings.UnnecessaryStringConcat.Found">
|
|
|
|
|
</rule>
|
2018-08-09 08:49:17 +00:00
|
|
|
|
2021-02-28 23:19:52 +00:00
|
|
|
<!-- Disallow usage of space -->
|
|
|
|
|
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent" />
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2019-02-10 11:59:09 +00:00
|
|
|
<!-- Check indent are done with spaces and with correct number -->
|
2011-08-28 14:33:55 +00:00
|
|
|
<!-- Disabled as this does not support tab -->
|
|
|
|
|
<!-- <rule ref="Generic.WhiteSpace.ScopeIndent" /> -->
|
2019-10-27 16:01:23 +00:00
|
|
|
|
2019-05-23 11:12:04 +00:00
|
|
|
<rule ref="Generic.WhiteSpace.ScopeIndent">
|
2024-02-12 02:30:19 +00:00
|
|
|
<properties>
|
|
|
|
|
<property name="indent" value="4"/>
|
|
|
|
|
<property name="tabIndent" value="true"/>
|
|
|
|
|
</properties>
|
2019-05-23 11:12:04 +00:00
|
|
|
</rule>
|
2019-10-27 16:01:23 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- Check for duplicate class names -->
|
|
|
|
|
<!-- Disabled: We need this for dependency injection.
|
|
|
|
|
<rule ref="Generic.Classes.DuplicateClassName" />
|
|
|
|
|
-->
|
2020-05-03 20:47:43 +00:00
|
|
|
|
|
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- Rules from Squiz Standard -->
|
2019-10-16 18:00:01 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace.Indent" />
|
2019-02-03 13:29:45 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- There MUST NOT be trailing whitespace at the end of non-blank lines. -->
|
|
|
|
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="ignoreBlankLines" value="false"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" />
|
|
|
|
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" />
|
|
|
|
|
<!-- Disabled: We want to have 2 empty line as separator sometimes -->
|
|
|
|
|
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" >
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2019-10-16 18:00:01 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingAfterOpen" />
|
|
|
|
|
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
|
2018-08-21 12:03:02 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis" />
|
|
|
|
|
<rule ref="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace" />
|
|
|
|
|
<rule ref="Squiz.ControlStructures.ControlSignature.SpaceAfterKeyword" />
|
2020-05-20 22:02:33 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceAfterOpen" />
|
|
|
|
|
<rule ref="Squiz.ControlStructures.ForEachLoopDeclaration.SpaceBeforeClose" />
|
2019-02-02 17:25:01 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
|
|
|
|
|
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration.SpaceAfterFunction" />
|
|
|
|
|
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="equalsSpacing" value="1"/>
|
|
|
|
|
</properties>
|
2020-04-10 11:04:30 +00:00
|
|
|
</rule>
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="Squiz.Scope.MethodScope.Missing" />
|
2014-07-26 13:07:30 +00:00
|
|
|
|
2020-05-03 20:47:43 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- Rules from PEAR Standard -->
|
2014-07-26 13:07:30 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Classes.ClassDeclaration" />
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Commenting.ClassComment" />
|
2015-01-06 16:54:36 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Commenting.ClassComment.Missing" />
|
2018-08-09 08:49:17 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Commenting.ClassComment.MissingTag" />
|
2015-01-06 16:54:36 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Commenting.ClassComment.MissingAuthorTag">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2015-01-06 16:54:36 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Commenting.ClassComment.MissingCategoryTag">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.Commenting.ClassComment.MissingLicenseTag">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.Commenting.ClassComment.MissingLinkTag">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.Commenting.ClassComment.MissingPackageTag">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2015-01-06 16:54:36 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment" />
|
2015-01-06 16:54:36 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.Empty" />
|
2018-08-09 08:49:17 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
|
2015-02-10 20:49:39 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamName">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2015-02-10 20:49:39 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.ReturnNotRequired" />
|
2018-08-09 08:49:17 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.WrongStyle" />
|
2020-05-03 20:47:43 +00:00
|
|
|
|
2024-02-12 02:30:19 +00: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>
|
|
|
|
|
<rule ref="PEAR.Commenting.FunctionComment.ParameterNamesNotAligned">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Commenting.InlineComment" />
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2019-05-23 12:25:16 +00:00
|
|
|
<!-- Check position of { after a control structure like if (), while (), etc... -->
|
2019-10-16 18:00:01 +00:00
|
|
|
<!--
|
2019-05-23 12:25:16 +00:00
|
|
|
<rule ref="PEAR.ControlStructures.ControlSignature" />
|
|
|
|
|
-->
|
2011-08-28 14:33:55 +00:00
|
|
|
|
|
|
|
|
<!-- <rule ref="PEAR.ControlStructures.MultiLineCondition" /> -->
|
|
|
|
|
|
|
|
|
|
<!-- Test if () are removed for includes -->
|
2018-07-26 09:10:48 +00:00
|
|
|
<rule ref="PEAR.Files.IncludingFile" />
|
2019-05-23 12:25:16 +00:00
|
|
|
|
2020-05-12 22:29:46 +00:00
|
|
|
<!-- We disable this: We must be able to make require inside if -->
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Files.IncludingFile.UseInclude">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2020-05-20 22:02:33 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- We disable this. We must be allowed to use strict require instead of non strict include anywhere -->
|
|
|
|
|
<rule ref="PEAR.Files.IncludingFile.UseIncludeOnce">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2020-05-20 22:02:33 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Files.IncludingFile.UseRequire">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2020-05-20 22:02:33 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- We disable this: We want to allow include_once -->
|
|
|
|
|
<rule ref="PEAR.Files.IncludingFile.UseRequireOnce">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2011-08-28 14:33:55 +00:00
|
|
|
|
|
|
|
|
<rule ref="PEAR.Formatting.MultiLineAssignment" />
|
|
|
|
|
|
|
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature" />
|
|
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- We disable this: It returns a lot of false positive -->
|
|
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature.CloseBracketLine">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2020-05-20 22:02:33 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- We disable this: We want to allow small function on 1 line -->
|
|
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2019-10-16 18:00:01 +00:00
|
|
|
|
2020-05-12 22:29:46 +00:00
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature.EmptyLine" />
|
|
|
|
|
|
|
|
|
|
<!-- We disable this: Too many false positive -->
|
2012-08-27 15:55:15 +00:00
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature.Indent">
|
2020-05-12 22:29:46 +00:00
|
|
|
<severity>0</severity>
|
2012-08-27 15:55:15 +00:00
|
|
|
</rule>
|
2020-05-12 22:29:46 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceBeforeOpenBracket" />
|
|
|
|
|
<rule ref="PEAR.Functions.FunctionCallSignature.SpaceAfterCloseBracket" />
|
2018-08-09 08:49:17 +00:00
|
|
|
|
2011-08-28 14:33:55 +00:00
|
|
|
<rule ref="PEAR.Functions.ValidDefaultValue" />
|
|
|
|
|
|
|
|
|
|
<rule ref="PEAR.NamingConventions.ValidClassName" />
|
2012-03-18 16:51:40 +00:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidClassName.Invalid">
|
2024-02-12 02:30:19 +00:00
|
|
|
<severity>0</severity>
|
2012-03-18 16:16:46 +00:00
|
|
|
</rule>
|
2018-08-09 08:49:17 +00:00
|
|
|
|
2020-05-12 22:29:46 +00:00
|
|
|
<!-- We disable this: there is a lot of existing method not starting with a capital letter (class modXxxx, ...) -->
|
2013-09-10 10:11:08 +00:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCapital">
|
2020-05-12 22:29:46 +00:00
|
|
|
<severity>0</severity>
|
2011-08-28 17:40:51 +00:00
|
|
|
</rule>
|
2020-05-12 22:29:46 +00:00
|
|
|
<!-- some phpcs have a typo error in rule, so we add it this rule too with term "Captial" instead of "Capital" -->
|
2013-09-10 11:45:39 +00:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidClassName.StartWithCaptial">
|
2024-02-12 02:30:19 +00:00
|
|
|
<severity>0</severity>
|
2013-09-10 10:11:08 +00:00
|
|
|
</rule>
|
2018-08-09 08:49:17 +00:00
|
|
|
|
2011-08-28 14:33:55 +00:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName" />
|
2020-05-12 22:29:46 +00:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore" />
|
2014-08-28 10:31:57 +00:00
|
|
|
|
2020-05-12 22:29:46 +00:00
|
|
|
<!-- We disable this: there is a lot of existing function not starting with a capital letter (class modXxxx, ...) -->
|
2012-07-25 10:20:45 +00:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNameInvalid">
|
2024-02-12 02:30:19 +00:00
|
|
|
<severity>0</severity>
|
2012-07-25 10:20:45 +00:00
|
|
|
</rule>
|
2013-09-10 00:32:24 +00:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNoCapital">
|
2024-02-12 02:30:19 +00:00
|
|
|
<severity>0</severity>
|
2013-09-10 00:32:24 +00:00
|
|
|
</rule>
|
2020-05-12 22:29:46 +00:00
|
|
|
<!-- some phpcs have a typo error in rule, so we add it this rule too with term "Captial" instead of "Capital" -->
|
2011-09-16 17:57:09 +00:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.FunctionNoCaptial">
|
2024-02-12 02:30:19 +00:00
|
|
|
<severity>0</severity>
|
2011-09-16 17:57:09 +00:00
|
|
|
</rule>
|
2014-08-28 10:31:57 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!--<rule ref="PEAR.NamingConventions.ValidFunctionName.NotCamelCaps">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>-->
|
2018-08-14 08:21:34 +00:00
|
|
|
<!--<rule ref="PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps">
|
2024-02-12 02:30:19 +00:00
|
|
|
<severity>0</severity>
|
2018-08-14 08:21:34 +00:00
|
|
|
</rule>-->
|
2020-05-20 22:02:33 +00:00
|
|
|
|
2020-05-12 22:29:46 +00:00
|
|
|
<!-- We disable this: We don't want to have private methods prefixed with an underscore -->
|
2011-09-16 17:57:09 +00:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidFunctionName.PrivateNoUnderscore">
|
2024-02-12 02:30:19 +00:00
|
|
|
<severity>0</severity>
|
2011-08-28 17:08:13 +00:00
|
|
|
</rule>
|
2011-08-28 14:33:55 +00:00
|
|
|
|
2020-05-12 22:29:46 +00:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidVariableName" />
|
2018-08-29 19:25:22 +00:00
|
|
|
|
2015-06-05 13:52:18 +00:00
|
|
|
<!-- This is not in PSR2 -->
|
2020-05-12 22:29:46 +00:00
|
|
|
<!-- We disable this: We don't want to have private methods prefixed with an underscore -->
|
2015-06-05 13:52:18 +00:00
|
|
|
<rule ref="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore">
|
2024-02-12 02:30:19 +00:00
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2018-08-09 08:49:17 +00:00
|
|
|
|
2011-08-28 14:33:55 +00:00
|
|
|
<rule ref="PEAR.WhiteSpace.ObjectOperatorIndent" />
|
|
|
|
|
|
2012-01-05 00:06:50 +00:00
|
|
|
<!-- Need to be commented to be disabled
|
2011-12-30 13:32:33 +00:00
|
|
|
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace">
|
2024-02-12 02:30:19 +00:00
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
|
|
|
|
<rule ref="PEAR.WhiteSpace.ScopeClosingBrace.Line">
|
|
|
|
|
<severity>0</severity>
|
|
|
|
|
</rule>
|
2012-01-05 00:06:50 +00:00
|
|
|
-->
|
2018-08-09 08:49:17 +00:00
|
|
|
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- Already found as a Generic rule -->
|
2011-08-28 14:33:55 +00:00
|
|
|
<!-- <rule ref="PEAR.WhiteSpace.ScopeIndent" /> -->
|
|
|
|
|
|
2014-07-26 13:07:30 +00:00
|
|
|
|
2020-05-12 22:29:46 +00:00
|
|
|
<!-- Rules PSR 2 -->
|
2024-02-12 02:30:19 +00:00
|
|
|
<rule ref="PSR2.Classes.ClassDeclaration" />
|
|
|
|
|
<rule ref="PSR2.Methods.FunctionClosingBrace" />
|
|
|
|
|
<rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed" />
|
|
|
|
|
<rule ref="PSR2.Classes.ClassDeclaration" />
|
|
|
|
|
<rule ref="PSR2.Methods.FunctionClosingBrace" />
|
|
|
|
|
<rule ref="PSR2.Files.EndFileNewline.TooMany" />
|
2019-02-24 19:06:55 +00:00
|
|
|
<rule ref="PSR2.Files.EndFileNewline.NoneFound" />
|
|
|
|
|
<rule ref="PSR2.Methods.FunctionCallSignature.SpaceBeforeOpenBracket" />
|
2019-03-05 21:10:46 +00:00
|
|
|
<rule ref="PSR2.Classes.PropertyDeclaration.VarUsed" />
|
2024-02-12 02:30:19 +00:00
|
|
|
<!-- The closing ?> tag MUST be omitted from files containing only PHP. -->
|
|
|
|
|
<rule ref="PSR2.Files.ClosingTag"/>
|
2020-05-20 22:02:33 +00:00
|
|
|
|
2011-08-28 14:33:55 +00:00
|
|
|
</ruleset>
|