Skip to content

Commit 086fb17

Browse files
committed
chore: update config
1 parent 4392745 commit 086fb17

3 files changed

Lines changed: 139 additions & 1 deletion

File tree

phpstan.neon.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ parameters:
3030

3131
# These are too noisy at the moment:
3232
- '#Variable \$[a-zA-Z0-9_]+ might not be defined\.#'
33-
- '#Variable \$[a-zA-Z0-9_]+ in isset\(\) always exists and is not nullable\.#'
3433

3534
# Level 6:
3635

tests/phpstan/base.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ parameters:
3939
- ../../src/wp-admin/includes/class-ftp.php
4040
- ../../src/wp-admin/includes/class-pclzip.php
4141
- ../../src/wp-includes/atomlib.php
42+
- ../../src/wp-includes/class-avif-info.php
4243
- ../../src/wp-includes/class-json.php
4344
- ../../src/wp-includes/class-phpmailer.php
4445
- ../../src/wp-includes/class-requests.php

tests/phpstan/baseline/level-1.php

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,24 @@
2525
'count' => 1,
2626
'path' => __DIR__ . '/../../../src/wp-admin/includes/ajax-actions.php',
2727
];
28+
$ignoreErrors[] = [
29+
// identifier: isset.variable
30+
'message' => '#^Variable \\$results in isset\\(\\) always exists and is not nullable\\.$#',
31+
'count' => 1,
32+
'path' => __DIR__ . '/../../../src/wp-admin/includes/ajax-actions.php',
33+
];
34+
$ignoreErrors[] = [
35+
// identifier: isset.variable
36+
'message' => '#^Variable \\$_POST in isset\\(\\) always exists and is not nullable\\.$#',
37+
'count' => 1,
38+
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-custom-image-header.php',
39+
];
40+
$ignoreErrors[] = [
41+
// identifier: isset.variable
42+
'message' => '#^Variable \\$oitar in isset\\(\\) always exists and is not nullable\\.$#',
43+
'count' => 1,
44+
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-custom-image-header.php',
45+
];
2846
$ignoreErrors[] = [
2947
// identifier: isset.variable
3048
'message' => '#^Variable \\$transient in isset\\(\\) is never defined\\.$#',
@@ -67,6 +85,12 @@
6785
'count' => 1,
6886
'path' => __DIR__ . '/../../../src/wp-admin/includes/file.php',
6987
];
88+
$ignoreErrors[] = [
89+
// identifier: isset.variable
90+
'message' => '#^Variable \\$_POST in isset\\(\\) always exists and is not nullable\\.$#',
91+
'count' => 1,
92+
'path' => __DIR__ . '/../../../src/wp-admin/includes/media.php',
93+
];
7094
$ignoreErrors[] = [
7195
// identifier: empty.variable
7296
'message' => '#^Variable \\$callback in empty\\(\\) always exists and is not falsy\\.$#',
@@ -91,6 +115,18 @@
91115
'count' => 1,
92116
'path' => __DIR__ . '/../../../src/wp-admin/themes.php',
93117
];
118+
$ignoreErrors[] = [
119+
// identifier: isset.variable
120+
'message' => '#^Variable \\$area in isset\\(\\) always exists and is not nullable\\.$#',
121+
'count' => 1,
122+
'path' => __DIR__ . '/../../../src/wp-includes/block-template-utils.php',
123+
];
124+
$ignoreErrors[] = [
125+
// identifier: isset.variable
126+
'message' => '#^Variable \\$lightbox_settings in isset\\(\\) always exists and is not nullable\\.$#',
127+
'count' => 1,
128+
'path' => __DIR__ . '/../../../src/wp-includes/blocks/image.php',
129+
];
94130
$ignoreErrors[] = [
95131
// identifier: empty.variable
96132
'message' => '#^Variable \\$inner_blocks in empty\\(\\) always exists and is not falsy\\.$#',
@@ -121,6 +157,30 @@
121157
'count' => 1,
122158
'path' => __DIR__ . '/../../../src/wp-includes/class-pop3.php',
123159
];
160+
$ignoreErrors[] = [
161+
// identifier: isset.variable
162+
'message' => '#^Variable \\$block in isset\\(\\) always exists and is not nullable\\.$#',
163+
'count' => 1,
164+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-list.php',
165+
];
166+
$ignoreErrors[] = [
167+
// identifier: isset.variable
168+
'message' => '#^Variable \\$namespace in isset\\(\\) always exists and is not nullable\\.$#',
169+
'count' => 1,
170+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-parser.php',
171+
];
172+
$ignoreErrors[] = [
173+
// identifier: isset.variable
174+
'message' => '#^Variable \\$category_name in isset\\(\\) always exists and is not nullable\\.$#',
175+
'count' => 1,
176+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-pattern-categories-registry.php',
177+
];
178+
$ignoreErrors[] = [
179+
// identifier: isset.variable
180+
'message' => '#^Variable \\$pattern_name in isset\\(\\) always exists and is not nullable\\.$#',
181+
'count' => 1,
182+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-patterns-registry.php',
183+
];
124184
$ignoreErrors[] = [
125185
// identifier: empty.variable
126186
'message' => '#^Variable \\$block_type in empty\\(\\) always exists and is not falsy\\.$#',
@@ -139,6 +199,18 @@
139199
'count' => 1,
140200
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-comment-query.php',
141201
];
202+
$ignoreErrors[] = [
203+
// identifier: isset.variable
204+
'message' => '#^Variable \\$root in isset\\(\\) always exists and is not nullable\\.$#',
205+
'count' => 2,
206+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-customize-setting.php',
207+
];
208+
$ignoreErrors[] = [
209+
// identifier: isset.variable
210+
'message' => '#^Variable \\$value in isset\\(\\) always exists and is not nullable\\.$#',
211+
'count' => 1,
212+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-date-query.php',
213+
];
142214
$ignoreErrors[] = [
143215
// identifier: constructor.unusedParameter
144216
'message' => '#^Constructor of class WP_Feed_Cache_Transient has an unused parameter \\$location\\.$#',
@@ -151,6 +223,12 @@
151223
'count' => 1,
152224
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-feed-cache-transient.php',
153225
];
226+
$ignoreErrors[] = [
227+
// identifier: isset.variable
228+
'message' => '#^Variable \\$loader in isset\\(\\) always exists and is not nullable\\.$#',
229+
'count' => 1,
230+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-oembed.php',
231+
];
154232
$ignoreErrors[] = [
155233
// identifier: isset.variable
156234
'message' => '#^Variable \\$q in isset\\(\\) is never defined\\.$#',
@@ -187,12 +265,42 @@
187265
'count' => 1,
188266
'path' => __DIR__ . '/../../../src/wp-includes/comment.php',
189267
];
268+
$ignoreErrors[] = [
269+
// identifier: isset.variable
270+
'message' => '#^Variable \\$newrow in isset\\(\\) always exists and is not nullable\\.$#',
271+
'count' => 1,
272+
'path' => __DIR__ . '/../../../src/wp-includes/general-template.php',
273+
];
274+
$ignoreErrors[] = [
275+
// identifier: isset.variable
276+
'message' => '#^Variable \\$character_reference in isset\\(\\) always exists and is not nullable\\.$#',
277+
'count' => 1,
278+
'path' => __DIR__ . '/../../../src/wp-includes/html-api/class-wp-html-decoder.php',
279+
];
280+
$ignoreErrors[] = [
281+
// identifier: isset.variable
282+
'message' => '#^Variable \\$replacement in isset\\(\\) always exists and is not nullable\\.$#',
283+
'count' => 1,
284+
'path' => __DIR__ . '/../../../src/wp-includes/html-api/class-wp-html-tag-processor.php',
285+
];
190286
$ignoreErrors[] = [
191287
// identifier: empty.variable
192288
'message' => '#^Variable \\$attachment in empty\\(\\) always exists and is not falsy\\.$#',
193289
'count' => 1,
194290
'path' => __DIR__ . '/../../../src/wp-includes/media.php',
195291
];
292+
$ignoreErrors[] = [
293+
// identifier: isset.variable
294+
'message' => '#^Variable \\$file_info in isset\\(\\) always exists and is not nullable\\.$#',
295+
'count' => 1,
296+
'path' => __DIR__ . '/../../../src/wp-includes/media.php',
297+
];
298+
$ignoreErrors[] = [
299+
// identifier: isset.variable
300+
'message' => '#^Variable \\$user_already_exists in isset\\(\\) always exists and is not nullable\\.$#',
301+
'count' => 1,
302+
'path' => __DIR__ . '/../../../src/wp-includes/ms-functions.php',
303+
];
196304
$ignoreErrors[] = [
197305
// identifier: empty.variable
198306
'message' => '#^Variable \\$deprecated in empty\\(\\) always exists and is always falsy\\.$#',
@@ -205,6 +313,24 @@
205313
'count' => 1,
206314
'path' => __DIR__ . '/../../../src/wp-includes/pluggable.php',
207315
];
316+
$ignoreErrors[] = [
317+
// identifier: isset.variable
318+
'message' => '#^Variable \\$wp_actions in isset\\(\\) always exists and is not nullable\\.$#',
319+
'count' => 1,
320+
'path' => __DIR__ . '/../../../src/wp-includes/plugin.php',
321+
];
322+
$ignoreErrors[] = [
323+
// identifier: isset.variable
324+
'message' => '#^Variable \\$wp_current_filter in isset\\(\\) always exists and is not nullable\\.$#',
325+
'count' => 1,
326+
'path' => __DIR__ . '/../../../src/wp-includes/plugin.php',
327+
];
328+
$ignoreErrors[] = [
329+
// identifier: isset.variable
330+
'message' => '#^Variable \\$wp_filters in isset\\(\\) always exists and is not nullable\\.$#',
331+
'count' => 1,
332+
'path' => __DIR__ . '/../../../src/wp-includes/plugin.php',
333+
];
208334
$ignoreErrors[] = [
209335
// identifier: empty.variable
210336
'message' => '#^Variable \\$last_error_code in empty\\(\\) always exists and is not falsy\\.$#',
@@ -229,6 +355,12 @@
229355
'count' => 1,
230356
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php',
231357
];
358+
$ignoreErrors[] = [
359+
// identifier: isset.variable
360+
'message' => '#^Variable \\$default in isset\\(\\) always exists and is not nullable\\.$#',
361+
'count' => 2,
362+
'path' => __DIR__ . '/../../../src/wp-includes/taxonomy.php',
363+
];
232364
$ignoreErrors[] = [
233365
// identifier: empty.variable
234366
'message' => '#^Variable \\$object_terms in empty\\(\\) always exists and is not falsy\\.$#',
@@ -277,5 +409,11 @@
277409
'count' => 1,
278410
'path' => __DIR__ . '/../../../src/wp-includes/widgets.php',
279411
];
412+
$ignoreErrors[] = [
413+
// identifier: isset.variable
414+
'message' => '#^Variable \\$HTTP_RAW_POST_DATA in isset\\(\\) always exists and is not nullable\\.$#',
415+
'count' => 1,
416+
'path' => __DIR__ . '/../../../src/xmlrpc.php',
417+
];
280418

281419
return ['parameters' => ['ignoreErrors' => $ignoreErrors]];

0 commit comments

Comments
 (0)