Skip to content

Commit 0802cca

Browse files
committed
chore: regenerate PHPStan baselines
1 parent fcc54d5 commit 0802cca

7 files changed

Lines changed: 1516 additions & 2014 deletions

File tree

tests/phpstan/baseline/level-0.php

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,68 @@
22

33
$ignoreErrors = [];
44
$ignoreErrors[] = [
5-
// identifier: return.missing
65
'message' => '#^Method WP_Filesystem_SSH2\\:\\:touch\\(\\) should return bool but return statement is missing\\.$#',
6+
'identifier' => 'return.missing',
77
'count' => 1,
88
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-ssh2.php',
99
];
1010
$ignoreErrors[] = [
11-
// identifier: class.notFound
1211
'message' => '#^Instantiated class WP_Press_This_Plugin not found\\.$#',
12+
'identifier' => 'class.notFound',
13+
'count' => 1,
14+
'path' => __DIR__ . '/../../../src/wp-admin/press-this.php',
15+
];
16+
$ignoreErrors[] = [
17+
'message' => '#^Path in include\\(\\) "/press\\-this/class\\-wp\\-press\\-this\\-plugin\\.php" is not a file or it does not exist\\.$#',
18+
'identifier' => 'include.fileNotFound',
1319
'count' => 1,
1420
'path' => __DIR__ . '/../../../src/wp-admin/press-this.php',
1521
];
1622
$ignoreErrors[] = [
17-
// identifier: return.missing
1823
'message' => '#^Method WP_Theme_JSON\\:\\:should_override_preset\\(\\) should return bool but return statement is missing\\.$#',
24+
'identifier' => 'return.missing',
1925
'count' => 1,
2026
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-theme-json.php',
2127
];
2228
$ignoreErrors[] = [
23-
// identifier: return.missing
2429
'message' => '#^Method WP_Customize_Background_Image_Setting\\:\\:update\\(\\) should return bool but return statement is missing\\.$#',
30+
'identifier' => 'return.missing',
2531
'count' => 1,
2632
'path' => __DIR__ . '/../../../src/wp-includes/customize/class-wp-customize-background-image-setting.php',
2733
];
2834
$ignoreErrors[] = [
29-
// identifier: return.missing
3035
'message' => '#^Method WP_Customize_Filter_Setting\\:\\:update\\(\\) should return bool but return statement is missing\\.$#',
36+
'identifier' => 'return.missing',
3137
'count' => 1,
3238
'path' => __DIR__ . '/../../../src/wp-includes/customize/class-wp-customize-filter-setting.php',
3339
];
3440
$ignoreErrors[] = [
35-
// identifier: return.missing
3641
'message' => '#^Method WP_Customize_Header_Image_Setting\\:\\:update\\(\\) should return bool but return statement is missing\\.$#',
37-
'count' => 1,
42+
'identifier' => 'return.missing',
43+
'count' => 2,
3844
'path' => __DIR__ . '/../../../src/wp-includes/customize/class-wp-customize-header-image-setting.php',
3945
];
4046
$ignoreErrors[] = [
41-
// identifier: class.notFound
4247
'message' => '#^Class GdImage not found\\.$#',
48+
'identifier' => 'class.notFound',
4349
'count' => 1,
4450
'path' => __DIR__ . '/../../../src/wp-includes/media.php',
4551
];
4652
$ignoreErrors[] = [
47-
// identifier: function.nameCase
4853
'message' => '#^Call to function get_current_user_id\\(\\) with incorrect case\\: get_current_user_ID$#',
54+
'identifier' => 'function.nameCase',
4955
'count' => 1,
5056
'path' => __DIR__ . '/../../../src/wp-includes/script-loader.php',
5157
];
5258
$ignoreErrors[] = [
53-
// identifier: new.static
5459
'message' => '#^Unsafe usage of new static\\(\\)\\.$#',
60+
'identifier' => 'new.static',
5561
'count' => 1,
5662
'path' => __DIR__ . '/../../../src/wp-includes/style-engine/class-wp-style-engine-css-rules-store.php',
5763
];
5864
$ignoreErrors[] = [
59-
// identifier: variable.undefined
6065
'message' => '#^Undefined variable\\: \\$s$#',
66+
'identifier' => 'variable.undefined',
6167
'count' => 1,
6268
'path' => __DIR__ . '/../../../src/wp-includes/template.php',
6369
];

tests/phpstan/baseline/level-1.php

Lines changed: 18 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -2,194 +2,104 @@
22

33
$ignoreErrors = [];
44
$ignoreErrors[] = [
5-
// identifier: variable.undefined
6-
'message' => '#^Call to function compact\\(\\) contains possibly undefined variable \\$comment_author\\.$#',
7-
'count' => 1,
8-
'path' => __DIR__ . '/../../../src/wp-admin/includes/ajax-actions.php',
9-
];
10-
$ignoreErrors[] = [
11-
// identifier: variable.undefined
12-
'message' => '#^Call to function compact\\(\\) contains possibly undefined variable \\$comment_author_email\\.$#',
13-
'count' => 1,
14-
'path' => __DIR__ . '/../../../src/wp-admin/includes/ajax-actions.php',
15-
];
16-
$ignoreErrors[] = [
17-
// identifier: variable.undefined
18-
'message' => '#^Call to function compact\\(\\) contains possibly undefined variable \\$comment_author_url\\.$#',
19-
'count' => 1,
20-
'path' => __DIR__ . '/../../../src/wp-admin/includes/ajax-actions.php',
21-
];
22-
$ignoreErrors[] = [
23-
// identifier: variable.undefined
24-
'message' => '#^Call to function compact\\(\\) contains possibly undefined variable \\$user_id\\.$#',
25-
'count' => 1,
26-
'path' => __DIR__ . '/../../../src/wp-admin/includes/ajax-actions.php',
27-
];
28-
$ignoreErrors[] = [
29-
// identifier: isset.variable
30-
'message' => '#^Variable \\$_POST in isset\\(\\) always exists and is not nullable\\.$#',
31-
'count' => 1,
32-
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-custom-image-header.php',
33-
];
34-
$ignoreErrors[] = [
35-
// identifier: isset.variable
36-
'message' => '#^Variable \\$oitar 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: constructor.unusedParameter
425
'message' => '#^Constructor of class WP_Filesystem_Direct has an unused parameter \\$arg\\.$#',
6+
'identifier' => 'constructor.unusedParameter',
437
'count' => 1,
448
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-direct.php',
459
];
4610
$ignoreErrors[] = [
47-
// identifier: empty.variable
4811
'message' => '#^Variable \\$class in empty\\(\\) always exists and is always falsy\\.$#',
12+
'identifier' => 'empty.variable',
4913
'count' => 1,
5014
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-posts-list-table.php',
5115
];
5216
$ignoreErrors[] = [
53-
// identifier: empty.variable
5417
'message' => '#^Variable \\$connection_type in empty\\(\\) always exists and is not falsy\\.$#',
18+
'identifier' => 'empty.variable',
5519
'count' => 1,
5620
'path' => __DIR__ . '/../../../src/wp-admin/includes/file.php',
5721
];
5822
$ignoreErrors[] = [
59-
// identifier: isset.variable
60-
'message' => '#^Variable \\$_POST in isset\\(\\) always exists and is not nullable\\.$#',
61-
'count' => 1,
62-
'path' => __DIR__ . '/../../../src/wp-admin/includes/media.php',
63-
];
64-
$ignoreErrors[] = [
65-
// identifier: empty.variable
6623
'message' => '#^Variable \\$parent_file in empty\\(\\) always exists and is not falsy\\.$#',
24+
'identifier' => 'empty.variable',
6725
'count' => 1,
6826
'path' => __DIR__ . '/../../../src/wp-admin/themes.php',
6927
];
7028
$ignoreErrors[] = [
71-
// identifier: isset.variable
72-
'message' => '#^Variable \\$area in isset\\(\\) always exists and is not nullable\\.$#',
73-
'count' => 1,
74-
'path' => __DIR__ . '/../../../src/wp-includes/block-template-utils.php',
75-
];
76-
$ignoreErrors[] = [
77-
// identifier: empty.variable
7829
'message' => '#^Variable \\$addl_path in empty\\(\\) always exists and is always falsy\\.$#',
30+
'identifier' => 'empty.variable',
7931
'count' => 1,
8032
'path' => __DIR__ . '/../../../src/wp-includes/canonical.php',
8133
];
8234
$ignoreErrors[] = [
83-
// identifier: empty.variable
8435
'message' => '#^Variable \\$object_subtype in empty\\(\\) always exists and is not falsy\\.$#',
36+
'identifier' => 'empty.variable',
8537
'count' => 2,
8638
'path' => __DIR__ . '/../../../src/wp-includes/capabilities.php',
8739
];
8840
$ignoreErrors[] = [
89-
// identifier: isset.variable
90-
'message' => '#^Variable \\$namespace in isset\\(\\) always exists and is not nullable\\.$#',
91-
'count' => 1,
92-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-parser.php',
93-
];
94-
$ignoreErrors[] = [
95-
// identifier: empty.variable
9641
'message' => '#^Variable \\$block_type in empty\\(\\) always exists and is not falsy\\.$#',
42+
'identifier' => 'empty.variable',
9743
'count' => 1,
9844
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-supports.php',
9945
];
10046
$ignoreErrors[] = [
101-
// identifier: empty.variable
10247
'message' => '#^Variable \\$status_clauses in empty\\(\\) always exists and is not falsy\\.$#',
48+
'identifier' => 'empty.variable',
10349
'count' => 1,
10450
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-comment-query.php',
10551
];
10652
$ignoreErrors[] = [
107-
// identifier: constructor.unusedParameter
108-
'message' => '#^Constructor of class WP_Feed_Cache_Transient has an unused parameter \\$location\\.$#',
109-
'count' => 1,
110-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-feed-cache-transient.php',
111-
];
112-
$ignoreErrors[] = [
113-
// identifier: constructor.unusedParameter
114-
'message' => '#^Constructor of class WP_Feed_Cache_Transient has an unused parameter \\$type\\.$#',
115-
'count' => 1,
116-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-feed-cache-transient.php',
117-
];
118-
$ignoreErrors[] = [
119-
// identifier: isset.variable
120-
'message' => '#^Variable \\$loader in isset\\(\\) always exists and is not nullable\\.$#',
121-
'count' => 1,
122-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-oembed.php',
123-
];
124-
$ignoreErrors[] = [
125-
// identifier: isset.variable
12653
'message' => '#^Variable \\$q in isset\\(\\) is never defined\\.$#',
54+
'identifier' => 'isset.variable',
12755
'count' => 1,
12856
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-query.php',
12957
];
13058
$ignoreErrors[] = [
131-
// identifier: empty.variable
13259
'message' => '#^Variable \\$search in empty\\(\\) always exists and is not falsy\\.$#',
60+
'identifier' => 'empty.variable',
13361
'count' => 1,
13462
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-query.php',
13563
];
13664
$ignoreErrors[] = [
137-
// identifier: empty.variable
13865
'message' => '#^Variable \\$status_type_clauses in empty\\(\\) always exists and is not falsy\\.$#',
66+
'identifier' => 'empty.variable',
13967
'count' => 1,
14068
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-query.php',
14169
];
14270
$ignoreErrors[] = [
143-
// identifier: empty.variable
14471
'message' => '#^Variable \\$modes_str in empty\\(\\) always exists and is not falsy\\.$#',
72+
'identifier' => 'empty.variable',
14573
'count' => 1,
14674
'path' => __DIR__ . '/../../../src/wp-includes/class-wpdb.php',
14775
];
14876
$ignoreErrors[] = [
149-
// identifier: isset.variable
150-
'message' => '#^Variable \\$newrow in isset\\(\\) always exists and is not nullable\\.$#',
151-
'count' => 1,
152-
'path' => __DIR__ . '/../../../src/wp-includes/general-template.php',
153-
];
154-
$ignoreErrors[] = [
155-
// identifier: isset.variable
156-
'message' => '#^Variable \\$user_already_exists in isset\\(\\) always exists and is not nullable\\.$#',
157-
'count' => 1,
158-
'path' => __DIR__ . '/../../../src/wp-includes/ms-functions.php',
159-
];
160-
$ignoreErrors[] = [
161-
// identifier: empty.variable
16277
'message' => '#^Variable \\$deprecated in empty\\(\\) always exists and is always falsy\\.$#',
78+
'identifier' => 'empty.variable',
16379
'count' => 1,
16480
'path' => __DIR__ . '/../../../src/wp-includes/pluggable.php',
16581
];
16682
$ignoreErrors[] = [
167-
// identifier: empty.variable
16883
'message' => '#^Variable \\$schema in empty\\(\\) is never defined\\.$#',
84+
'identifier' => 'empty.variable',
16985
'count' => 1,
17086
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php',
17187
];
17288
$ignoreErrors[] = [
173-
// identifier: isset.variable
174-
'message' => '#^Variable \\$default in isset\\(\\) always exists and is not nullable\\.$#',
175-
'count' => 2,
176-
'path' => __DIR__ . '/../../../src/wp-includes/taxonomy.php',
177-
];
178-
$ignoreErrors[] = [
179-
// identifier: empty.variable
180-
'message' => '#^Variable \\$object_terms in empty\\(\\) always exists and is not falsy\\.$#',
89+
'message' => '#^Variable \\$the_parent in empty\\(\\) always exists and is not falsy\\.$#',
90+
'identifier' => 'empty.variable',
18191
'count' => 1,
18292
'path' => __DIR__ . '/../../../src/wp-includes/taxonomy.php',
18393
];
18494
$ignoreErrors[] = [
185-
// identifier: isset.variable
18695
'message' => '#^Variable \\$s in isset\\(\\) is never defined\\.$#',
96+
'identifier' => 'isset.variable',
18797
'count' => 1,
18898
'path' => __DIR__ . '/../../../src/wp-includes/template.php',
18999
];
190100
$ignoreErrors[] = [
191-
// identifier: empty.variable
192101
'message' => '#^Variable \\$old_user_data in empty\\(\\) always exists and is not falsy\\.$#',
102+
'identifier' => 'empty.variable',
193103
'count' => 1,
194104
'path' => __DIR__ . '/../../../src/wp-includes/user.php',
195105
];

0 commit comments

Comments
 (0)