forked from braintree/braintree_php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpcs.xml
73 lines (63 loc) · 3.09 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
<?xml version="1.0"?>
<ruleset name="MyRuleset">
<description>Coding standard based on internal Braintree coding practices.</description>
<!-- PSR-12 is the latest PHP published standard for code style.
This ruleset includes PSR1 & 2 -->
<rule ref="PSR12"/>
<!-- Exclude some rules -->
<!-- This rule pops up for Braintree.php and test files,
and aren't really that smelly for those instances -->
<rule ref="PSR1">
<exclude-pattern>tests/*</exclude-pattern>
<exclude name="PSR1.Files.SideEffects"/>
</rule>
<!-- Our tests use a syntax `methodname_doesAThingWeTest` so let's ignore -->
<rule ref="PSR1.Methods.CamelCapsMethodName">
<exclude-pattern>tests/*</exclude-pattern>
</rule>
<rule ref="Generic.Files.LineLength">
<exclude name="Generic.Files.LineLength.TooLong"/>
</rule>
<!-- We mark internal properties and methods with `_`
so let's ignore these two rules to save ignore comment lines -->
<rule ref="PSR2.Classes.PropertyDeclaration">
<exclude name="PSR2.Classes.PropertyDeclaration"/>
</rule>
<rule ref="PSR2.Methods.MethodDeclaration">
<exclude name="PSR2.Methods.MethodDeclaration"/>
</rule>
<!-- NEXT_MAJOR_VERSION remove this rule and add visibility modifiers,
https://www.php.net/manual/en/language.oop5.constants.php -->
<rule ref="PSR12.Properties.ConstantVisibility">
<exclude name="PSR12.Properties.ConstantVisibility"/>
</rule>
<!-- scan for missing phpDoc -->
<rule ref="Generic.Commenting">
<exclude-pattern>tests/*</exclude-pattern>
<exclude-pattern>lib/Braintree/Test/*</exclude-pattern>
<exclude name="Generic.Commenting.DocComment.ShortNotCapital"/>
<exclude name="Generic.Commenting.DocComment.LongNotCapital"/>
</rule>
<!-- NEXT_MAJOR_VERSION there are a number of public functions that are marked to ignore the rule
PEAR.Commenting.FunctionComment.Missing in their class files. This is because they're public functions
that aren't meant to be used by merchants as standalone functions. -->
<rule ref="PEAR.Commenting">
<properties>
<property name="minimumVisibility" value="public" />
</properties>
<exclude-pattern>tests/*</exclude-pattern>
<exclude-pattern>lib/Braintree/Test/*</exclude-pattern>
<exclude name="PEAR.Commenting.FileComment.Missing"/>
<exclude name="PEAR.Commenting.ClassComment.MissingCategoryTag"/>
<exclude name="PEAR.Commenting.ClassComment.MissingAuthorTag"/>
<exclude name="PEAR.Commenting.ClassComment.MissingLicenseTag"/>
<exclude name="PEAR.Commenting.ClassComment.MissingLinkTag"/>
<exclude name="PEAR.Commenting.ClassComment.CategoryTagOrder"/>
<exclude name="PEAR.Commenting.ClassComment.PackageTagOrder"/>
<exclude name="PEAR.Commenting.ClassComment.MissingPackageTag"/>
<exclude name="PEAR.Commenting.FunctionComment.WrongStyle"/>
<exclude name="PEAR.Commenting.FileComment.WrongStyle"/>
</rule>
<!-- Custom sniffs made to fit Braintree SDK best practices -->
<rule ref="BTStandard"/>
</ruleset>