-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathphpcs.xml
78 lines (68 loc) · 3.08 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
<?xml version="1.0"?>
<ruleset name="AppTest">
<arg name="basepath" value="."/>
<arg name="extensions" value="php"/>
<arg name="parallel" value="45"/>
<arg name="cache" value=".phpcs-cache"/>
<arg name="colors"/>
<arg name="ignore" value="server.php,resources/views,*blade.php*,database/migrations,database/factories,*Routes/*.php"/>
<!-- Ignore warnings and show progress of the run -->
<arg value="nps"/>
<!-- Folders that will be tracked -->
<file>app</file>
<file>bootstrap/app.php</file>
<file>config</file>
<!-- <file>database</file> -->
<file>routes</file>
<file>tests</file>
<rule ref="PSR12"/>
<!-- [Object Calisthenics rules for PHP_CodeSniffer](https://github.com/object-calisthenics/phpcs-calisthenics-rules) -->
<config name="installed_paths" value="vendor/object-calisthenics/phpcs-calisthenics-rules/src/ObjectCalisthenics"/>
<!-- Rule 1: Only X indentation level per function/method (with default values) -->
<rule ref="ObjectCalisthenics.Metrics.MaxNestingLevel">
<properties>
<property name="maxNestingLevel" value="2"/>
</properties>
</rule>
<!-- Rule 2: There is no "else" -->
<!-- <rule ref="ObjectCalisthenics.ControlStructures.NoElse"/> -->
<!-- Rule 5: Only one object operator (->) per line (with default values) -->
<rule ref="ObjectCalisthenics.CodeAnalysis.OneObjectOperatorPerLine">
<properties>
<property name="variablesHoldingAFluentInterface" type="array" value="$queryBuilder,$containerBuilder"/>
<property name="methodsStartingAFluentInterface" type="array" value="createQueryBuilder,table,where,query,select,join"/>
<property name="methodsEndingAFluentInterface" type="array" value="execute,getQuery,get,first,find,value"/>
</properties>
</rule>
<!-- Rule 6: Do not abbreviate (with default values) -->
<rule ref="ObjectCalisthenics.NamingConventions.ElementNameMinimalLength">
<properties>
<property name="minLength" value="3"/>
<property name="allowedShortNames" type="array" value="i,id,to,up"/>
</properties>
</rule>
<!-- Rule 7: Keep your classes small (with default values) -->
<rule ref="ObjectCalisthenics.Files.ClassTraitAndInterfaceLength">
<properties>
<property name="maxLength" value="200"/>
</properties>
</rule>
<rule ref="ObjectCalisthenics.Files.FunctionLength">
<properties>
<property name="maxLength" value="40"/>
</properties>
</rule>
<rule ref="ObjectCalisthenics.Metrics.PropertyPerClassLimit">
<properties>
<property name="maxCount" value="10"/>
</properties>
</rule>
<rule ref="ObjectCalisthenics.Metrics.MethodPerClassLimit">
<properties>
<property name="maxCount" value="10"/>
</properties>
</rule>
<!-- Rule 9: Do not Use Getters and Setters -->
<rule ref="ObjectCalisthenics.Classes.ForbiddenPublicProperty"/>
<rule ref="ObjectCalisthenics.NamingConventions.NoSetter"/>
</ruleset>