-
Notifications
You must be signed in to change notification settings - Fork 3
/
phpstan.neon.dist
102 lines (94 loc) · 4.49 KB
/
phpstan.neon.dist
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
parameters:
phpVersion: 70200
level: 9
paths:
- Yoast
bootstrapFiles:
- phpunit-bootstrap.php
scanDirectories:
- vendor/wp-coding-standards/wpcs/WordPress
# treatPhpDocTypesAsCertain: false
# reportUnmatchedIgnoredErrors: false
dynamicConstantNames:
- YOASTCS_ABOVE_THRESHOLD
ignoreErrors:
# Level 3
-
# This is an issue with the PHPCS docs. Can't be helped.
message: '`^Property PHP_CodeSniffer\\Config::\$basepath \(string\) does not accept null\.$`'
path: Yoast/Tests/Utils/PSR4PathsTraitTest.php
count: 1
-
# This is a test specifically checking the handling when an invalid value is passed, so this is okay.
message: '`^Property YoastCS\\Yoast\\Tests\\Utils\\PSR4PathsTraitTest::\$psr4_paths \(array\<string, string\>\) does not accept array\<int, string\>\.$`'
path: Yoast/Tests/Utils/PSR4PathsTraitTest.php
count: 1
# Level 4
-
# Bug in PHPStan: PHPStan doesn't seem to like uninitialized properties...
message: '`^Property \S+Sniff::\$target_paths \(array<string, string>\) in isset\(\) is not nullable\.$`'
path: Yoast/Sniffs/Files/TestDoublesSniff.php
count: 1
-
# Defensive coding in the PSR4PathsTrait as the property value is user provided via the ruleset. This is okay.
message: '`^Strict comparison using === between true and false will always evaluate to false\.$`'
paths:
- Yoast/Sniffs/Files/FileNameSniff.php
- Yoast/Sniffs/NamingConventions/NamespaceNameSniff.php
- Yoast/Tests/Utils/PSR4PathsTraitTest.php
# Level 5
# We're not using strict types, so this will be juggled without any issues.
- '#^Parameter \#3 \$value of method \S+File::recordMetric\(\) expects string, \(?(float|int|bool)(<[^>]+>)?(\|(float|int|bool)(<[^>]+>)?)*\)? given\.$#'
# Level 7
-
# False positive: the explode will never return `false` as it is never given an empty string separator.
message: '`^Parameter #2 \$array of function array_map expects array, array<int, string>\|false given\.$`'
path: Yoast/Sniffs/Commenting/CoversTagSniff.php
count: 1
-
# False positive: the preg_replace will never return `null` as the regex is valid.
message: '`^Parameter #1 \$str of function strtolower expects string, string\|null given\.$`'
path: Yoast/Sniffs/Files/FileNameSniff.php
count: 1
-
# False positive: the preg_replace will never return `null` as the regex is valid.
message: '`^Parameter #2 \$str of function explode expects string, string\|null given\.$`'
path: Yoast/Sniffs/NamingConventions/NamespaceNameSniff.php
count: 1
-
# False positive: the passed value will only ever be an integer, PHPStan just doesn't know the shape of the array.
message: '`^Binary operation "\+" between int\|string and 1 results in an error\.$`'
count: 2
path: Yoast/Sniffs/NamingConventions/ValidHookNameSniff.php
-
# False positive: the passed value will only ever be an integer, PHPStan just doesn't know the shape of the array.
message: '`^Parameter #2 \$start of method PHP_CodeSniffer\\Files\\File::findNext\(\) expects int, int\|string given\.$`'
count: 2
path: Yoast/Sniffs/NamingConventions/ValidHookNameSniff.php
-
# False positive: the passed value will only ever be an integer, PHPStan just doesn't know the shape of the array.
message: '`^Parameter #1 \$stackPtr of method PHP_CodeSniffer\\Fixer::replaceToken\(\) expects int, int\|string given\.$`'
path: Yoast/Sniffs/Yoast/JsonEncodeAlternativeSniff.php
count: 1
-
# This is a test specifically checking type handling, so this is okay.
message: '`^Parameter #1 \$path of static method YoastCS\\Yoast\\Utils\\PathHelper::trailingslashit\(\) expects string, bool\|string given\.$`'
path: Yoast/Tests/Utils/PathHelperTest.php
count: 1
# Not a real issue (x 4), PHPstan just doesn't know the format of the array well enough.
-
message: '`^Binary operation "\+" between int\|string and 1 results in an error\.$`'
count: 2
path: Yoast/Sniffs/Tools/BrainMonkeyRaceConditionSniff.php
-
message: '`^Parameter #2 \$start of method PHP_CodeSniffer\\Files\\File::findNext\(\) expects int, int\|string given\.$`'
count: 2
path: Yoast/Sniffs/Tools/BrainMonkeyRaceConditionSniff.php
-
message: '`^Binary operation "\+" between int\|string and 1 results in an error\.$`'
count: 1
path: Yoast/Sniffs/Yoast/JsonEncodeAlternativeSniff.php
-
message: '`^Parameter #2 \$start of method PHP_CodeSniffer\\Files\\File::findNext\(\) expects int, int\|string given\.$`'
count: 1
path: Yoast/Sniffs/Yoast/JsonEncodeAlternativeSniff.php