| @@ -1,37 +1,149 @@ | ||
| 1 | 1 | <?xml version="1.0"?> |
| 2 | -<ruleset name="WooCommerce Coding Standards"> | |
| 3 | - <description>Packetery WP plugin coding standards ruleset.</description> | |
| 2 | +<ruleset name="Packeta WordPress WooCommerce Plugin Coding Standards"> | |
| 3 | + <description>Packetery WP plugin coding standards ruleset.</description> | |
| 4 | + <arg name="basepath" value="."/> | |
| 5 | + <arg name="cache" value="temp/.phpcs-cache"/> | |
| 6 | + <arg name="colors"/> | |
| 7 | + <arg name="extensions" value="php"/> | |
| 8 | + <arg name="parallel" value="20"/> | |
| 9 | + <arg name="tab-width" value="4"/> | |
| 10 | + <arg name="encoding" value="utf-8"/> | |
| 11 | + <arg value="p"/> | |
| 12 | + <arg value="s"/> | |
| 4 | 13 | |
| 5 | - <file>cli</file> | |
| 6 | - <file>src</file> | |
| 7 | - <file>bootstrap.php</file> | |
| 8 | - <file>bootstrap-cli.php</file> | |
| 9 | - <file>packeta.php</file> | |
| 14 | + <file>cli</file> | |
| 15 | + <file>src/Packetery</file> | |
| 16 | + <file>bootstrap.php</file> | |
| 17 | + <file>bootstrap-cli.php</file> | |
| 18 | + <file>packeta.php</file> | |
| 19 | + <file>uninstall.php</file> | |
| 20 | + <file>tests</file> | |
| 10 | 21 | |
| 11 | - <!-- Configs --> | |
| 12 | - <config name="minimum_supported_wp_version" value="5.0" /> | |
| 22 | + <exclude-pattern>src/Packetery/Module/Shipping/Generated/</exclude-pattern> | |
| 23 | + <exclude-pattern>tests/bootstrap.php</exclude-pattern> | |
| 13 | 24 | |
| 14 | - <!-- Rules --> | |
| 15 | - <rule ref="WooCommerce-Core"> | |
| 16 | - <exclude name="Generic.Arrays.DisallowShortArraySyntax.Found"/> | |
| 17 | - <exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/> | |
| 18 | - <exclude name="WordPress.Files.FileName.InvalidClassFileName"/> | |
| 19 | - <exclude name="WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase"/> | |
| 20 | - <exclude name="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase"/> | |
| 21 | - <exclude name="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase"/> | |
| 22 | - <exclude name="WordPress.NamingConventions.ValidVariableName.InterpolatedVariableNotSnakeCase"/> | |
| 23 | - <exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid"/> | |
| 24 | - <exclude name="PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore"/> | |
| 25 | - <exclude name="WordPress.NamingConventions.ValidFunctionName.MethodDoubleUnderscore"/> | |
| 26 | - </rule> | |
| 25 | + <!-- Configs --> | |
| 26 | + <config name="minimum_supported_wp_version" value="6.3"/> | |
| 27 | 27 | |
| 28 | - <rule ref="WordPress.WP.I18n"> | |
| 29 | - <properties> | |
| 30 | - <property name="text_domain" type="array" value="packeta" /> | |
| 31 | - </properties> | |
| 32 | - </rule> | |
| 28 | + <ini name="error_reporting" value="E_ALL & ~E_DEPRECATED"/> | |
| 33 | 29 | |
| 34 | - <rule ref="PHPCompatibility"> | |
| 35 | - <exclude-pattern>tests/</exclude-pattern> | |
| 36 | - </rule> | |
| 30 | + <!-- Rules --> | |
| 31 | + <rule ref="WooCommerce-Core"> | |
| 32 | + <exclude name="Generic.Arrays.DisallowShortArraySyntax.Found"/> | |
| 33 | + <exclude name="Generic.CodeAnalysis.UselessOverridingMethod"/> | |
| 34 | + <exclude name="Generic.CodeAnalysis.EmptyStatement.DetectedCatch"/> | |
| 35 | + <exclude name="Universal.Arrays.DisallowShortArraySyntax.Found"/> | |
| 36 | + <exclude name="Universal.Operators.DisallowShortTernary.Found"/> | |
| 37 | + <exclude name="Universal.Operators.DisallowStandalonePostIncrementDecrement.PostIncrementFound"/> | |
| 38 | + <exclude name="WordPress.Files.FileName.NotHyphenatedLowercase"/> | |
| 39 | + <exclude name="WordPress.Files.FileName.InvalidClassFileName"/> | |
| 40 | + <exclude name="WordPress.NamingConventions.ValidVariableName.PropertyNotSnakeCase"/> | |
| 41 | + <exclude name="WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase"/> | |
| 42 | + <exclude name="WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase"/> | |
| 43 | + <exclude name="WordPress.NamingConventions.ValidVariableName.InterpolatedVariableNotSnakeCase"/> | |
| 44 | + <exclude name="WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid"/> | |
| 45 | + <exclude name="PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore"/> | |
| 46 | + <exclude name="WordPress.NamingConventions.ValidFunctionName.MethodDoubleUnderscore"/> | |
| 47 | + <exclude name="Squiz.Commenting.FunctionCommentThrowTag.WrongNumber"/> | |
| 48 | + <exclude name="Squiz.Commenting.FileComment.Missing"/> | |
| 49 | + <exclude name="Squiz.Commenting.ClassComment.Missing"/> | |
| 50 | + <exclude name="Squiz.Commenting.FunctionComment.Missing"/> | |
| 51 | + <exclude name="Squiz.Commenting.FunctionComment.MissingParamTag"/> | |
| 52 | + <exclude name="Squiz.Commenting.FunctionComment.MissingParamComment"/> | |
| 53 | + <exclude name="Squiz.Commenting.VariableComment.Missing"/> | |
| 54 | + <exclude name="Squiz.Commenting.FunctionComment.EmptyThrows"/> | |
| 55 | + <exclude name="Squiz.Commenting.FunctionComment.ParamCommentFullStop"/> | |
| 56 | + <exclude name="Squiz.Commenting.FunctionComment.ThrowsNoFullStop"/> | |
| 57 | + <exclude name="Squiz.Commenting.InlineComment.InvalidEndChar"/> | |
| 58 | + <exclude name="Generic.Commenting.DocComment.MissingShort"/> | |
| 59 | + <exclude name="PSR2.Classes.ClassDeclaration.CloseBraceAfterBody"/> | |
| 60 | + <exclude name="WordPress.Security.EscapeOutput.ExceptionNotEscaped"/> | |
| 61 | + <exclude name="WordPress.PHP.YodaConditions.NotYoda"/> | |
| 62 | + </rule> | |
| 63 | + | |
| 64 | + <rule ref="Generic.ControlStructures.DisallowYodaConditions.Found"/> | |
| 65 | + <rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison"/> | |
| 66 | + | |
| 67 | + <rule ref="WordPress.WP.I18n"> | |
| 68 | + <properties> | |
| 69 | + <property name="text_domain" type="array" value="packeta"/> | |
| 70 | + </properties> | |
| 71 | + </rule> | |
| 72 | + | |
| 73 | + <rule ref="WordPress.WP.Capabilities"> | |
| 74 | + <properties> | |
| 75 | + <property name="custom_capabilities" type="array"> | |
| 76 | + <element value="manage_woocommerce" /> | |
| 77 | + </property> | |
| 78 | + </properties> | |
| 79 | + </rule> | |
| 80 | + | |
| 81 | + <rule ref="Squiz.NamingConventions.ValidVariableName"> | |
| 82 | + <exclude name="Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore"/> | |
| 83 | + </rule> | |
| 84 | + | |
| 85 | + <rule ref="Squiz.WhiteSpace.FunctionSpacing"> | |
| 86 | + <properties> | |
| 87 | + <property name="spacing" value="1" /> | |
| 88 | + <property name="spacingBeforeFirst" value="0" /> | |
| 89 | + <property name="spacingAfterLast" value="0" /> | |
| 90 | + </properties> | |
| 91 | + </rule> | |
| 92 | + | |
| 93 | + <rule ref="Squiz.WhiteSpace.FunctionOpeningBraceSpace" /> | |
| 94 | + | |
| 95 | + <rule ref="SlevomatCodingStandard.Namespaces.UnusedUses"> | |
| 96 | + <properties> | |
| 97 | + <property name="searchAnnotations" value="true"/> | |
| 98 | + </properties> | |
| 99 | + </rule> | |
| 100 | + | |
| 101 | + <rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/> | |
| 102 | + | |
| 103 | + <rule ref="SlevomatCodingStandard.Classes.ConstantSpacing"> | |
| 104 | + <properties> | |
| 105 | + <property name="minLinesCountBeforeWithComment" value="1"/> | |
| 106 | + <property name="maxLinesCountBeforeWithComment" value="1"/> | |
| 107 | + <property name="minLinesCountBeforeWithoutComment" value="0"/> | |
| 108 | + <property name="maxLinesCountBeforeWithoutComment" value="1"/> | |
| 109 | + </properties> | |
| 110 | + </rule> | |
| 111 | + | |
| 112 | + <rule ref="SlevomatCodingStandard.Classes.PropertySpacing"> | |
| 113 | + <properties> | |
| 114 | + <property name="minLinesCountBeforeWithComment" value="1"/> | |
| 115 | + <property name="maxLinesCountBeforeWithComment" value="1"/> | |
| 116 | + <property name="minLinesCountBeforeWithoutComment" value="0"/> | |
| 117 | + <property name="maxLinesCountBeforeWithoutComment" value="0"/> | |
| 118 | + </properties> | |
| 119 | + </rule> | |
| 120 | + | |
| 121 | + <rule ref="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing"> | |
| 122 | + <properties> | |
| 123 | + <property name="linesCountBefore" value="1"/> | |
| 124 | + </properties> | |
| 125 | + </rule> | |
| 126 | + | |
| 127 | + <rule ref="SlevomatCodingStandard.Namespaces.NamespaceSpacing"> | |
| 128 | + <properties> | |
| 129 | + <property name="linesCountBeforeNamespace" value="1"/> | |
| 130 | + <property name="linesCountAfterNamespace" value="1"/> | |
| 131 | + </properties> | |
| 132 | + </rule> | |
| 133 | + | |
| 134 | + <rule ref="SlevomatCodingStandard.Namespaces.UseSpacing"> | |
| 135 | + <properties> | |
| 136 | + <property name="linesCountBeforeFirstUse" value="1"/> | |
| 137 | + <property name="linesCountBetweenUseTypes" value="1"/> | |
| 138 | + <property name="linesCountAfterLastUse" value="1"/> | |
| 139 | + </properties> | |
| 140 | + </rule> | |
| 141 | + | |
| 142 | + <rule ref="SlevomatCodingStandard.Classes.ClassMemberSpacing"> | |
| 143 | + <properties> | |
| 144 | + <property name="linesCountBetweenMembers" value="1"/> | |
| 145 | + </properties> | |
| 146 | + </rule> | |
| 147 | + | |
| 148 | + <rule ref="PHPCompatibility"/> | |
| 37 | 149 | </ruleset> |