|
1 | 1 | includes: |
2 | 2 | - %rootDir%/conf/bleedingEdge.neon |
3 | 3 | - %rootDir%/../phpstan-strict-rules/rules.neon |
| 4 | + - %rootDir%/../../shipmonk/phpstan-rules/rules.neon |
4 | 5 |
|
5 | 6 | parameters: |
6 | 7 | level: max |
7 | 8 | scanDirectories: |
8 | 9 | - %rootDir%/../../squizlabs/php_codesniffer/src |
9 | 10 | ignoreErrors: |
| 11 | + # Common for tests |
| 12 | + |
10 | 13 | - |
11 | | - message: "#^Parameter \\#1 \\$errors of method Forrest79\\\\PhpCsIgnores\\\\File\\:\\:setErrors\\(\\) expects array\\<int, array\\<int, list\\<array\\<string, mixed\\>\\>\\>\\>, array\\<non\\-empty\\-array\\<int\\|string, non\\-empty\\-list\\<mixed\\>\\>\\> given\\.$#" |
12 | | - count: 1 |
13 | | - path: src/File.php |
| 14 | + message: '#^Cannot access offset .+\.$#' |
| 15 | + count: 54 |
| 16 | + path: tests/run-tests.php |
| 17 | + |
| 18 | + # Baseline |
14 | 19 |
|
15 | 20 | - |
16 | | - message: "#^Parameter \\#1 \\$warnings of method Forrest79\\\\PhpCsIgnores\\\\File\\:\\:setWarnings\\(\\) expects array\\<int, array\\<int, list\\<array\\<string, mixed\\>\\>\\>\\>, array\\<non\\-empty\\-array\\<int\\|string, list\\<mixed\\>\\>\\> given\\.$#" |
| 21 | + message: '#^Parameter \#1 \$errors of method Forrest79\\PhpCsIgnores\\File\:\:setErrors\(\) expects array\<int, array\<int, list\<array\<string, mixed\>\>\>\>, array\<non\-empty\-array\<non\-empty\-list\<non\-empty\-array\>\>\> given\.$#' |
| 22 | + identifier: argument.type |
17 | 23 | count: 1 |
18 | 24 | path: src/File.php |
19 | 25 |
|
20 | 26 | - |
21 | | - message: "#^Parameter \\#1 \\$warnings of method Forrest79\\\\PhpCsIgnores\\\\File\\:\\:setWarnings\\(\\) expects array\\<int, array\\<int, list\\<array\\<string, mixed\\>\\>\\>\\>, array\\{\\}\\|array\\{1\\: array\\{1\\: non\\-empty\\-array\\<array\\<string, mixed\\>\\>\\}\\} given\\.$#" |
| 27 | + message: '#^Parameter \#1 \$warnings of method Forrest79\\PhpCsIgnores\\File\:\:setWarnings\(\) expects array\<int, array\<int, list\<array\<string, mixed\>\>\>\>, array\<non\-empty\-array\<list\<non\-empty\-array\>\>\> given\.$#' |
| 28 | + identifier: argument.type |
22 | 29 | count: 1 |
23 | 30 | path: src/File.php |
24 | 31 |
|
25 | 32 | - |
26 | | - message: "#^Parameter \\#2 \\$values of function vsprintf expects array\\<bool\\|float\\|int\\|string\\|null\\>, array given\\.$#" |
| 33 | + message: '#^Parameter \#2 \$values of function vsprintf expects array\<bool\|float\|int\|string\|null\>, array\<mixed\> given\.$#' |
| 34 | + identifier: argument.type |
27 | 35 | count: 1 |
28 | 36 | path: src/File.php |
29 | 37 |
|
30 | 38 | - |
31 | | - message: "#^Cannot access offset 0 on mixed\\.$#" |
| 39 | + message: '#^Cannot access offset 0 on mixed\.$#' |
| 40 | + identifier: offsetAccess.nonOffsetAccessible |
32 | 41 | count: 1 |
33 | 42 | path: src/PhpCsInjections.php |
34 | 43 |
|
35 | 44 | - |
36 | | - message: "#^Cannot access offset 1 on mixed\\.$#" |
| 45 | + message: '#^Cannot access offset 1 on mixed\.$#' |
| 46 | + identifier: offsetAccess.nonOffsetAccessible |
37 | 47 | count: 1 |
38 | 48 | path: src/PhpCsInjections.php |
39 | 49 |
|
40 | 50 | - |
41 | | - message: "#^Constant PHP_CODESNIFFER_VERBOSITY not found\\.$#" |
| 51 | + message: '#^Comparison mixed \> int contains non\-comparable type, only int\|float\|string\|DateTimeInterface or comparable tuple is allowed\.$#' |
| 52 | + identifier: shipmonk.comparingNonComparableTypes |
42 | 53 | count: 2 |
43 | 54 | path: src/PhpCsInjections.php |
44 | 55 |
|
45 | 56 | - |
46 | | - message: "#^Method Forrest79\\\\PhpCsIgnores\\\\PhpCsInjections\\:\\:mkdir\\(\\) should return bool but returns mixed\\.$#" |
| 57 | + message: '#^Constant PHP_CODESNIFFER_VERBOSITY not found\.$#' |
| 58 | + identifier: constant.notFound |
| 59 | + count: 2 |
| 60 | + path: src/PhpCsInjections.php |
| 61 | + |
| 62 | + - |
| 63 | + message: '#^Method Forrest79\\PhpCsIgnores\\PhpCsInjections\:\:mkdir\(\) should return bool but returns mixed\.$#' |
| 64 | + identifier: return.type |
47 | 65 | count: 1 |
48 | 66 | path: src/PhpCsInjections.php |
49 | 67 |
|
50 | 68 | - |
51 | | - message: "#^Method Forrest79\\\\PhpCsIgnores\\\\PhpCsInjections\\:\\:rename\\(\\) should return bool but returns mixed\\.$#" |
| 69 | + message: '#^Method Forrest79\\PhpCsIgnores\\PhpCsInjections\:\:rename\(\) should return bool but returns mixed\.$#' |
| 70 | + identifier: return.type |
52 | 71 | count: 1 |
53 | 72 | path: src/PhpCsInjections.php |
54 | 73 |
|
55 | 74 | - |
56 | | - message: "#^Method Forrest79\\\\PhpCsIgnores\\\\PhpCsInjections\\:\\:rmdir\\(\\) should return bool but returns mixed\\.$#" |
| 75 | + message: '#^Method Forrest79\\PhpCsIgnores\\PhpCsInjections\:\:rmdir\(\) should return bool but returns mixed\.$#' |
| 76 | + identifier: return.type |
57 | 77 | count: 1 |
58 | 78 | path: src/PhpCsInjections.php |
59 | 79 |
|
60 | 80 | - |
61 | | - message: "#^Method Forrest79\\\\PhpCsIgnores\\\\PhpCsInjections\\:\\:stream_metadata\\(\\) should return bool but returns mixed\\.$#" |
| 81 | + message: '#^Method Forrest79\\PhpCsIgnores\\PhpCsInjections\:\:stream_metadata\(\) should return bool but returns mixed\.$#' |
| 82 | + identifier: return.type |
62 | 83 | count: 4 |
63 | 84 | path: src/PhpCsInjections.php |
64 | 85 |
|
65 | 86 | - |
66 | | - message: "#^Method Forrest79\\\\PhpCsIgnores\\\\PhpCsInjections\\:\\:stream_tell\\(\\) should return int but returns int\\|false\\.$#" |
| 87 | + message: '#^Method Forrest79\\PhpCsIgnores\\PhpCsInjections\:\:stream_tell\(\) should return int but returns int\|(false|bool)\.$#' |
| 88 | + identifier: return.type |
67 | 89 | count: 1 |
68 | 90 | path: src/PhpCsInjections.php |
69 | 91 |
|
70 | 92 | - |
71 | | - message: "#^Method Forrest79\\\\PhpCsIgnores\\\\PhpCsInjections\\:\\:unlink\\(\\) should return bool but returns mixed\\.$#" |
| 93 | + message: '#^Method Forrest79\\PhpCsIgnores\\PhpCsInjections\:\:unlink\(\) should return bool but returns mixed\.$#' |
| 94 | + identifier: return.type |
72 | 95 | count: 1 |
73 | 96 | path: src/PhpCsInjections.php |
74 | 97 |
|
75 | 98 | - |
76 | | - message: "#^Only booleans are allowed in a ternary operator condition, int\\<0, 1\\> given\\.$#" |
| 99 | + message: '#^Missing native return typehint array\|(false|bool)$#' |
| 100 | + identifier: shipmonk.missingNativeReturnTypehint |
77 | 101 | count: 1 |
78 | 102 | path: src/PhpCsInjections.php |
79 | 103 |
|
80 | 104 | - |
81 | | - message: "#^Only booleans are allowed in a ternary operator condition, int\\<0, 2\\> given\\.$#" |
| 105 | + message: '#^Missing native return typehint int\|(false|bool)$#' |
| 106 | + identifier: shipmonk.missingNativeReturnTypehint |
82 | 107 | count: 1 |
83 | 108 | path: src/PhpCsInjections.php |
84 | 109 |
|
85 | 110 | - |
86 | | - message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|null given\\.$#" |
| 111 | + message: '#^Missing native return typehint mixed$#' |
| 112 | + identifier: shipmonk.missingNativeReturnTypehint |
| 113 | + count: 2 |
| 114 | + path: src/PhpCsInjections.php |
| 115 | + |
| 116 | + - |
| 117 | + message: '#^Missing native return typehint string\|(false|bool)#' |
| 118 | + identifier: shipmonk.missingNativeReturnTypehint |
| 119 | + count: 2 |
| 120 | + path: src/PhpCsInjections.php |
| 121 | + |
| 122 | + - |
| 123 | + message: '#^Only booleans are allowed in a ternary operator condition, int\<0, 1\> given\.$#' |
| 124 | + identifier: ternary.condNotBoolean |
87 | 125 | count: 1 |
88 | 126 | path: src/PhpCsInjections.php |
89 | 127 |
|
90 | 128 | - |
91 | | - message: "#^Parameter \\#1 \\$stream of function feof expects resource, resource\\|null given\\.$#" |
| 129 | + message: '#^Only booleans are allowed in a ternary operator condition, int\<0, 2\> given\.$#' |
| 130 | + identifier: ternary.condNotBoolean |
92 | 131 | count: 1 |
93 | 132 | path: src/PhpCsInjections.php |
94 | 133 |
|
95 | 134 | - |
96 | | - message: "#^Parameter \\#1 \\$stream of function fflush expects resource, resource\\|null given\\.$#" |
| 135 | + message: '#^Parameter \#1 \$stream of function fclose expects resource, resource\|null given\.$#' |
| 136 | + identifier: argument.type |
97 | 137 | count: 1 |
98 | 138 | path: src/PhpCsInjections.php |
99 | 139 |
|
100 | 140 | - |
101 | | - message: "#^Parameter \\#1 \\$stream of function flock expects resource, resource\\|null given\\.$#" |
| 141 | + message: '#^Parameter \#1 \$stream of function feof expects resource, resource\|null given\.$#' |
| 142 | + identifier: argument.type |
102 | 143 | count: 1 |
103 | 144 | path: src/PhpCsInjections.php |
104 | 145 |
|
105 | 146 | - |
106 | | - message: "#^Parameter \\#1 \\$stream of function fread expects resource, resource\\|null given\\.$#" |
| 147 | + message: '#^Parameter \#1 \$stream of function fflush expects resource, resource\|null given\.$#' |
| 148 | + identifier: argument.type |
107 | 149 | count: 1 |
108 | 150 | path: src/PhpCsInjections.php |
109 | 151 |
|
110 | 152 | - |
111 | | - message: "#^Parameter \\#1 \\$stream of function fseek expects resource, resource\\|null given\\.$#" |
| 153 | + message: '#^Parameter \#1 \$stream of function flock expects resource, resource\|null given\.$#' |
| 154 | + identifier: argument.type |
112 | 155 | count: 1 |
113 | 156 | path: src/PhpCsInjections.php |
114 | 157 |
|
115 | 158 | - |
116 | | - message: "#^Parameter \\#1 \\$stream of function fstat expects resource, resource\\|null given\\.$#" |
| 159 | + message: '#^Parameter \#1 \$stream of function fread expects resource, resource\|null given\.$#' |
| 160 | + identifier: argument.type |
117 | 161 | count: 1 |
118 | 162 | path: src/PhpCsInjections.php |
119 | 163 |
|
120 | 164 | - |
121 | | - message: "#^Parameter \\#1 \\$stream of function ftell expects resource, resource\\|null given\\.$#" |
| 165 | + message: '#^Parameter \#1 \$stream of function fseek expects resource, resource\|null given\.$#' |
| 166 | + identifier: argument.type |
122 | 167 | count: 1 |
123 | 168 | path: src/PhpCsInjections.php |
124 | 169 |
|
125 | 170 | - |
126 | | - message: "#^Parameter \\#1 \\$stream of function ftruncate expects resource, resource\\|null given\\.$#" |
| 171 | + message: '#^Parameter \#1 \$stream of function fstat expects resource, resource\|null given\.$#' |
| 172 | + identifier: argument.type |
127 | 173 | count: 1 |
128 | 174 | path: src/PhpCsInjections.php |
129 | 175 |
|
130 | 176 | - |
131 | | - message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, resource\\|null given\\.$#" |
| 177 | + message: '#^Parameter \#1 \$stream of function ftell expects resource, resource\|null given\.$#' |
| 178 | + identifier: argument.type |
132 | 179 | count: 1 |
133 | 180 | path: src/PhpCsInjections.php |
134 | 181 |
|
135 | 182 | - |
136 | | - message: "#^Parameter \\#2 \\$code of callable callable\\(string, string\\)\\: string expects string, mixed given\\.$#" |
| 183 | + message: '#^Parameter \#1 \$stream of function ftruncate expects resource, resource\|null given\.$#' |
| 184 | + identifier: argument.type |
137 | 185 | count: 1 |
138 | 186 | path: src/PhpCsInjections.php |
139 | 187 |
|
140 | 188 | - |
141 | | - message: "#^Parameter \\#2 \\$length of function fread expects int\\<0, max\\>, int given\\.$#" |
| 189 | + message: '#^Parameter \#1 \$stream of function fwrite expects resource, resource\|null given\.$#' |
| 190 | + identifier: argument.type |
142 | 191 | count: 1 |
143 | 192 | path: src/PhpCsInjections.php |
144 | 193 |
|
145 | 194 | - |
146 | | - message: "#^Parameter \\#2 \\$size of function ftruncate expects int\\<0, max\\>, int given\\.$#" |
| 195 | + message: '#^Parameter \#2 \$code of callable callable\(string, string\)\: string expects string, mixed given\.$#' |
| 196 | + identifier: argument.type |
147 | 197 | count: 1 |
148 | 198 | path: src/PhpCsInjections.php |
149 | 199 |
|
150 | 200 | - |
151 | | - message: "#^Property Forrest79\\\\PhpCsIgnores\\\\PhpCsInjections\\:\\:\\$handle \\(resource\\|null\\) does not accept mixed\\.$#" |
152 | | - count: 2 |
| 201 | + message: '#^Parameter \#2 \$length of function fread expects int\<1, max\>, int given\.$#' |
| 202 | + identifier: argument.type |
| 203 | + count: 1 |
153 | 204 | path: src/PhpCsInjections.php |
154 | 205 |
|
155 | 206 | - |
156 | | - message: "#^Property Forrest79\\\\PhpCsIgnores\\\\PhpCsInjections\\:\\:\\$handle \\(resource\\|null\\) does not accept resource\\|false\\.$#" |
| 207 | + message: '#^Parameter \#2 \$size of function ftruncate expects int\<0, max\>, int given\.$#' |
| 208 | + identifier: argument.type |
157 | 209 | count: 1 |
158 | 210 | path: src/PhpCsInjections.php |
159 | 211 |
|
160 | 212 | - |
161 | | - message: "#^Result of function rewinddir \\(void\\) is used\\.$#" |
| 213 | + message: '#^Property Forrest79\\PhpCsIgnores\\PhpCsInjections\:\:\$handle \(resource\|null\) does not accept mixed\.$#' |
| 214 | + identifier: assign.propertyType |
| 215 | + count: 2 |
| 216 | + path: src/PhpCsInjections.php |
| 217 | + |
| 218 | + - |
| 219 | + message: '#^Public property `context` not marked as readonly\.$#' |
| 220 | + identifier: shipmonk.publicPropertyNotReadonly |
162 | 221 | count: 1 |
163 | 222 | path: src/PhpCsInjections.php |
164 | 223 |
|
165 | 224 | - |
166 | | - message: "#^Trying to invoke string but it might not be a callable\\.$#" |
| 225 | + message: '#^Result of function rewinddir \(void\) is used\.$#' |
| 226 | + identifier: function.void |
167 | 227 | count: 1 |
168 | 228 | path: src/PhpCsInjections.php |
169 | 229 |
|
170 | 230 | - |
171 | | - message: '#^Cannot access offset .+\.$#' |
172 | | - count: 54 |
173 | | - path: tests/run-tests.php |
| 231 | + message: '#^Trying to invoke string but it might not be a callable\.$#' |
| 232 | + identifier: callable.nonCallable |
| 233 | + count: 1 |
| 234 | + path: src/PhpCsInjections.php |
0 commit comments