-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpcs.xml
More file actions
42 lines (36 loc) · 2.05 KB
/
Copy pathphpcs.xml
File metadata and controls
42 lines (36 loc) · 2.05 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
<?xml version="1.0"?>
<ruleset name="AdminerDesktop">
<description>
Type-safety rules for the PHP we wrote: native property and constant types, and short
array syntax.
phpstan (level 6) owns parameter/return/value types; this owns what phpstan cannot say
— a property or constant must be a native declaration, not a bare @var — and the [] vs array()
style phpstan does not judge. Everything that ships verbatim from the adminer release
is excluded: it keeps its own conventions and is not ours to report on.
</description>
<!-- Our code only. -->
<file>app</file>
<file>cli</file>
<!-- composer's tree lives under app/ now; it is not ours to sniff. -->
<exclude-pattern>app/vendor/*</exclude-pattern>
<exclude-pattern>app/adminer.php</exclude-pattern>
<exclude-pattern>app/editor.php</exclude-pattern>
<exclude-pattern>app/src/Settings/Plugins/available/*</exclude-pattern>
<exclude-pattern>app/src/Settings/Theme/designs/*</exclude-pattern>
<!-- slevomat ships no phpcs-4 installer plugin, so register its standard by hand rather
than relying on one. Relative to the repo root, where phpcs is run from; vendor/ is
under app/. -->
<config name="installed_paths" value="app/vendor/slevomat/coding-standard"/>
<!-- [] not array(). -->
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<!-- Every property carries a native type; a bare @var is not enough. The one property that
cannot (it overrides an untyped one in adminer's base class) opts out with a
phpcs:ignore comment on the line. -->
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint"/>
<!-- Same for class constants, and phpstan cannot say this either: its level-6
missing-type rule for constants only looks *inside* a type that is already written
(an array with no value type, an ungenericised generic), so `const MAX = 2000` with
no type at all is invisible to it. Constants have carried native types since PHP
8.3, so there is no reason for ours not to. -->
<rule ref="SlevomatCodingStandard.TypeHints.ClassConstantTypeHint"/>
</ruleset>