-
Notifications
You must be signed in to change notification settings - Fork 2
/
phpcs.xml
139 lines (131 loc) · 5.94 KB
/
phpcs.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?xml version="1.0" encoding="UTF-8"?>
<!--
@copyright Copyright (c) 2018-2020 Payvision B.V. (https://www.payvision.com/)
@license see LICENCE.TXT
-->
<ruleset>
<description>PHP_CodeSniffer ruleset for Payvision PHP SDK</description>
<!-- include root folder of project -->
<file>src</file>
<file>tests</file>
<!-- exclude paths -->
<exclude-pattern>./vendor</exclude-pattern>
<!-- This code is generated and therefore excluded from static code analysis: -->
<exclude-pattern>./src/Domain/Payments</exclude-pattern>
<exclude-pattern>./src/Domain/Checkouts</exclude-pattern>
<exclude-pattern>./src/Domain/Paymentlink</exclude-pattern>
<exclude-pattern>./src/Application/Payments</exclude-pattern>
<exclude-pattern>./src/Application/Checkouts</exclude-pattern>
<exclude-pattern>./src/Application/Paymentlink</exclude-pattern>
<!-- Arguments -->
<arg value="sp"/>
<arg name="colors"/>
<!-- PSR2 standard -->
<rule ref="PSR2"/>
<!-- PHP compatibility -->
<rule ref="PHPCompatibility"/>
<config name="testVersion" value="7.1-"/>
<!-- Extra rules -->
<rule ref="Generic.Arrays.ArrayIndent"/>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array" value="empty=>null,isset=>null,is_null=>null,var_dump=>null"/>
</properties>
</rule>
<rule ref="Generic.PHP.Syntax"/>
<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="MySource.PHP.GetRequestData"/>
<rule ref="Generic.Commenting.Fixme"/>
<rule ref="Generic.Commenting.Todo"/>
<rule ref="Generic.CodeAnalysis.EmptyStatement"/>
<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.UselessOverridingMethod"/>
<rule ref="Generic.Metrics.CyclomaticComplexity">
<properties>
<property name="complexity" value="10"/>
<property name="absoluteComplexity" value="20"/>
</properties>
</rule>
<rule ref="PSR12.Operators.OperatorSpacing"/>
<!-- 3rd party -->
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants"/>
<rule ref="SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions"/>
<rule ref="ObjectCalisthenics.Files.FunctionLength">
<properties>
<property name="maxLength" value="25"/>
</properties>
</rule>
<rule ref="ObjectCalisthenics.Metrics.MaxNestingLevel">
<properties>
<property name="maxNestingLevel" value="3"/>
</properties>
</rule>
<rule ref="ObjectCalisthenics.Metrics.MethodPerClassLimit">
<properties>
<property name="maxCount" value="10"/>
</properties>
</rule>
<rule ref="ObjectCalisthenics.Metrics.PropertyPerClassLimit">
<properties>
<property name="maxCount" value="10"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.UnusedPrivateElements"/>
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties>
<property name="allowFullyQualifiedGlobalFunctions" value="true"/>
<property name="allowFullyQualifiedGlobalConstants" value="true"/>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.UnusedUses">
<properties>
<property name="searchAnnotations" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace"/>
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
<properties>
<property name="newlinesCountBetweenOpenTagAndDeclare" value="2"/>
<property name="spacesCountAroundEqualsSign" value="0"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing"/>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingAnyTypeHint"/>
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingAnyTypeHint"/>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingAnyTypeHint"/>
<rule ref="SlevomatCodingStandard.TypeHints.UselessConstantTypeHint"/>
<rule ref="SlevomatCodingStandard.Classes.EmptyLinesAroundClassBraces">
<properties>
<property name="linesCountAfterOpeningBrace" value="0"/>
<property name="linesCountBeforeClosingBrace" value="0"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators"/>
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison"/>
<rule ref="SlevomatCodingStandard.ControlStructures.RequireShortTernaryOperator"/>
<rule ref="SlevomatCodingStandard.PHP.TypeCast"/>
<rule ref="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming"/>
<rule ref="Squiz.NamingConventions.ValidVariableName.NotCamelCaps"/>
<rule ref="Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps"/>
<rule ref="Squiz.Strings.DoubleQuoteUsage.ContainsVar"/>
<rule ref="Squiz.WhiteSpace.FunctionSpacing">
<properties>
<property name="spacing" value="1"/>
<property name="spacingBeforeFirst" value="0"/>
<property name="spacingAfterLast" value="0"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>
</ruleset>