-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
55 lines (47 loc) · 2.25 KB
/
phpcs.xml.dist
File metadata and controls
55 lines (47 loc) · 2.25 KB
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
<?xml version="1.0"?>
<ruleset name="Request PHP Client Standard">
<description>PHPCS rules mapping TS ESLint intent to PHP</description>
<file>src</file>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>generated/*</exclude-pattern>
<exclude-pattern>specs/*</exclude-pattern>
<exclude-pattern>tests/*</exclude-pattern>
<!-- Base standard -->
<rule ref="PSR12"/>
<!-- Enforce imports and ordering -->
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"/>
<rule ref="SlevomatCodingStandard.Namespaces.DisallowGroupUse"/>
<rule ref="SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses"/>
<!-- (Optional) ClassName↔FileName check omitted for now due to PSR-4 mapping path nuances. -->
<!-- Type hints everywhere -->
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint"/>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint"/>
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint"/>
<!-- File length rule omitted (PHPCS lacks a portable FileLength sniff); complexity limits handled by PHPMD. -->
<!-- Forbid debug/output and risky file-level includes (maps no-console/import rules) -->
<rule ref="Generic.PHP.ForbiddenFunctions">
<properties>
<property name="forbiddenFunctions" type="array">
<element key="var_dump" value="print_r"/>
<element key="print_r" value="var_export"/>
<element key="die" value="throw_exception"/>
<element key="exit" value="throw_exception"/>
<element key="require" value="composer_autoload"/>
<element key="include" value="composer_autoload"/>
<element key="require_once" value="composer_autoload"/>
<element key="include_once" value="composer_autoload"/>
</property>
</properties>
</rule>
<!-- Forbid blanket ignore comments (maps eslint-comments/no-use && ban-ts-comment) -->
<rule ref="SlevomatCodingStandard.Commenting.ForbiddenAnnotations">
<properties>
<property name="forbiddenAnnotations" type="array">
<element value="@phpcs:ignore"/>
<element value="@phpcs:disable"/>
<element value="@phpstan-ignore-next-line"/>
<element value="@phpstan-ignore-line"/>
</property>
</properties>
</rule>
</ruleset>