-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml.dist
More file actions
51 lines (40 loc) · 2.1 KB
/
Copy pathphpcs.xml.dist
File metadata and controls
51 lines (40 loc) · 2.1 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
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Starisian Technologies" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/master/phpcs.xsd">
<description>Starisian Technologies PHP coding standard. PHP 8.2+, WordPress VIP.</description>
<!-- PHP 8.2 minimum -->
<config name="php_version" value="80200"/>
<!-- Exclude generated/vendor directories -->
<exclude-pattern>*/vendor/*</exclude-pattern>
<exclude-pattern>*/node_modules/*</exclude-pattern>
<exclude-pattern>*/build/*</exclude-pattern>
<exclude-pattern>*/dist/*</exclude-pattern>
<!-- Base rulesets -->
<rule ref="WordPress"/>
<!-- Strict types required on every file -->
<rule ref="Generic.PHP.RequireStrictTypes"/>
<!-- Encoding -->
<rule ref="Generic.Files.ByteOrderMark"/>
<rule ref="Generic.Files.LineEndings">
<properties>
<property name="eolChar" value="\n"/>
</properties>
</rule>
<!-- No SELECT * — enforced by VIP ruleset; explicit reminder -->
<!-- STD: PHP-002 — SELECT * is forbidden. Use explicit column lists. -->
<!-- Globals must be prefixed. Set prefix in consuming ruleset. -->
<!-- Consuming repos override: <rule ref="WordPress.NamingConventions.PrefixAllGlobals"><properties><property name="prefixes" type="array" value="your_prefix"/></properties></rule> -->
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<properties>
<!-- REQUIRED: Override this in the consuming repo's phpcs.xml with the actual plugin prefix -->
<property name="prefixes" type="array">
<element value="YOUR_PREFIX"/>
</property>
</properties>
</rule>
<!-- PHPStan level reference: minimum level 5, level 8 for core systems -->
<!-- Run separately: vendor/bin/phpstan analyse (level=5) -->
<!-- PSR-12 where not overridden by WordPress VIP -->
<rule ref="PSR2.Methods.MethodDeclaration"/>
<rule ref="PSR2.Classes.PropertyDeclaration"/>
<rule ref="Squiz.Scope.MethodScope"/>
</ruleset>