Repository navigation
Expand file tree
/
Copy pathphpstan.neon
More file actions
51 lines (50 loc) · 2.23 KB
/
Copy pathphpstan.neon
File metadata and controls
51 lines (50 loc) · 2.23 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
parameters:
level: 9
paths:
- src/Client
- tests
excludePaths:
- src/Proto
bootstrapFiles:
- tests/phpstan/bootstrap.php
ignoreErrors:
# composer.lock is not committed, so CI resolves the newest dev
# dependencies on every run. Newer phpstan(-phpunit) flags
# assertSame(literal, $obj->getter()) as method.alreadyNarrowedType
# in tests that assert a getter after seeding the state — the very
# assertions those tests exist for.
-
identifier: method.alreadyNarrowedType
paths:
- tests
# The only test of the custom rule below (issue #186) is this
# whitelist: the fixture holds the comparison shapes the rule must
# report, and reportUnmatched turns "the rule stopped firing" into a
# failed run (ignore.unmatched) instead of a silent pass. Scoped to the
# fixture path, so the same comparison anywhere else is still an error.
-
identifier: tikv.keyOrder.relationOnStrings
path: tests/Unit/Phpstan/KeyOrderRuleFixture.php
reportUnmatched: true
# The fixture compares '20' < '100' to document that PHP reads the two
# as the numbers 20 and 100, which phpstan's own constant folding
# concludes for itself. reportUnmatched is off here (unlike the entry
# above) so a phpstan version that stops folding it cannot break the
# build.
-
identifier: smaller.alwaysTrue
path: tests/Unit/Phpstan/KeyOrderRuleFixture.php
reportUnmatched: false
services:
# Issue #186: PHP compares two strings numerically when both are numeric
# strings, while TiKV orders keys bytewise. Every key comparison goes
# through CrazyGoat\TiKV\Client\Util\KeyOrder; this rule keeps it that way.
#
# Registering the rule under BOTH services (with the phpstan.rules.rule
# tag) and rules would instantiate it twice and report every finding
# twice — `rules:` only accepts plain class names, so the tagged service
# below is the single registration point.
-
class: CrazyGoat\TiKV\Phpstan\KeyOrderComparisonRule
tags:
- phpstan.rules.rule