Skip to content

Commit 27bc876

Browse files
committed
phpstan: regenerate baselines
1 parent 382dbb1 commit 27bc876

7 files changed

Lines changed: 1447 additions & 2197 deletions

File tree

tests/phpstan/baseline/level-0.php

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,68 +2,80 @@
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: function.notFound
1211
'message' => '#^Function get_file not found\\.$#',
12+
'identifier' => 'function.notFound',
1313
'count' => 1,
1414
'path' => __DIR__ . '/../../../src/wp-admin/load-scripts.php',
1515
];
1616
$ignoreErrors[] = [
17-
// identifier: function.notFound
1817
'message' => '#^Function get_file not found\\.$#',
18+
'identifier' => 'function.notFound',
1919
'count' => 1,
2020
'path' => __DIR__ . '/../../../src/wp-admin/load-styles.php',
2121
];
2222
$ignoreErrors[] = [
23-
// identifier: class.notFound
2423
'message' => '#^Instantiated class WP_Press_This_Plugin not found\\.$#',
24+
'identifier' => 'class.notFound',
25+
'count' => 1,
26+
'path' => __DIR__ . '/../../../src/wp-admin/press-this.php',
27+
];
28+
$ignoreErrors[] = [
29+
'message' => '#^Path in include\\(\\) "/press\\-this/class\\-wp\\-press\\-this\\-plugin\\.php" is not a file or it does not exist\\.$#',
30+
'identifier' => 'include.fileNotFound',
2531
'count' => 1,
2632
'path' => __DIR__ . '/../../../src/wp-admin/press-this.php',
2733
];
2834
$ignoreErrors[] = [
29-
// identifier: return.missing
3035
'message' => '#^Method WP_Theme_JSON\\:\\:should_override_preset\\(\\) should return bool but return statement is missing\\.$#',
36+
'identifier' => 'return.missing',
3137
'count' => 1,
3238
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-theme-json.php',
3339
];
3440
$ignoreErrors[] = [
35-
// identifier: return.missing
3641
'message' => '#^Method WP_Customize_Background_Image_Setting\\:\\:update\\(\\) should return bool but return statement is missing\\.$#',
42+
'identifier' => 'return.missing',
3743
'count' => 1,
3844
'path' => __DIR__ . '/../../../src/wp-includes/customize/class-wp-customize-background-image-setting.php',
3945
];
4046
$ignoreErrors[] = [
41-
// identifier: return.missing
4247
'message' => '#^Method WP_Customize_Filter_Setting\\:\\:update\\(\\) should return bool but return statement is missing\\.$#',
48+
'identifier' => 'return.missing',
4349
'count' => 1,
4450
'path' => __DIR__ . '/../../../src/wp-includes/customize/class-wp-customize-filter-setting.php',
4551
];
4652
$ignoreErrors[] = [
47-
// identifier: return.missing
4853
'message' => '#^Method WP_Customize_Header_Image_Setting\\:\\:update\\(\\) should return bool but return statement is missing\\.$#',
49-
'count' => 1,
54+
'identifier' => 'return.missing',
55+
'count' => 2,
5056
'path' => __DIR__ . '/../../../src/wp-includes/customize/class-wp-customize-header-image-setting.php',
5157
];
5258
$ignoreErrors[] = [
53-
// identifier: class.notFound
59+
'message' => '#^Unsafe usage of new static\\(\\)\\.$#',
60+
'identifier' => 'new.static',
61+
'count' => 2,
62+
'path' => __DIR__ . '/../../../src/wp-includes/html-api/class-wp-html-processor.php',
63+
];
64+
$ignoreErrors[] = [
5465
'message' => '#^Class GdImage not found\\.$#',
66+
'identifier' => 'class.notFound',
5567
'count' => 1,
5668
'path' => __DIR__ . '/../../../src/wp-includes/media.php',
5769
];
5870
$ignoreErrors[] = [
59-
// identifier: new.static
6071
'message' => '#^Unsafe usage of new static\\(\\)\\.$#',
72+
'identifier' => 'new.static',
6173
'count' => 1,
6274
'path' => __DIR__ . '/../../../src/wp-includes/style-engine/class-wp-style-engine-css-rules-store.php',
6375
];
6476
$ignoreErrors[] = [
65-
// identifier: variable.undefined
6677
'message' => '#^Undefined variable\\: \\$s$#',
78+
'identifier' => 'variable.undefined',
6779
'count' => 1,
6880
'path' => __DIR__ . '/../../../src/wp-includes/template.php',
6981
];

tests/phpstan/baseline/level-1.php

Lines changed: 13 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -2,178 +2,76 @@
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: isset.variable
84-
'message' => '#^Variable \\$namespace in isset\\(\\) always exists and is not nullable\\.$#',
85-
'count' => 1,
86-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-parser.php',
87-
];
88-
$ignoreErrors[] = [
89-
// identifier: empty.variable
9035
'message' => '#^Variable \\$block_type in empty\\(\\) always exists and is not falsy\\.$#',
36+
'identifier' => 'empty.variable',
9137
'count' => 1,
9238
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-supports.php',
9339
];
9440
$ignoreErrors[] = [
95-
// identifier: constructor.unusedParameter
96-
'message' => '#^Constructor of class WP_Feed_Cache_Transient has an unused parameter \\$location\\.$#',
97-
'count' => 1,
98-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-feed-cache-transient.php',
99-
];
100-
$ignoreErrors[] = [
101-
// identifier: constructor.unusedParameter
102-
'message' => '#^Constructor of class WP_Feed_Cache_Transient has an unused parameter \\$type\\.$#',
103-
'count' => 1,
104-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-feed-cache-transient.php',
105-
];
106-
$ignoreErrors[] = [
107-
// identifier: isset.variable
108-
'message' => '#^Variable \\$loader in isset\\(\\) always exists and is not nullable\\.$#',
109-
'count' => 1,
110-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-oembed.php',
111-
];
112-
$ignoreErrors[] = [
113-
// identifier: isset.variable
11441
'message' => '#^Variable \\$q in isset\\(\\) is never defined\\.$#',
42+
'identifier' => 'isset.variable',
11543
'count' => 1,
11644
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-query.php',
11745
];
11846
$ignoreErrors[] = [
119-
// identifier: empty.variable
12047
'message' => '#^Variable \\$search in empty\\(\\) always exists and is not falsy\\.$#',
48+
'identifier' => 'empty.variable',
12149
'count' => 1,
12250
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-query.php',
12351
];
12452
$ignoreErrors[] = [
125-
// identifier: empty.variable
12653
'message' => '#^Variable \\$status_type_clauses in empty\\(\\) always exists and is not falsy\\.$#',
54+
'identifier' => 'empty.variable',
12755
'count' => 1,
12856
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-query.php',
12957
];
13058
$ignoreErrors[] = [
131-
// identifier: empty.variable
132-
'message' => '#^Variable \\$modes_str in empty\\(\\) always exists and is not falsy\\.$#',
133-
'count' => 1,
134-
'path' => __DIR__ . '/../../../src/wp-includes/class-wpdb.php',
135-
];
136-
$ignoreErrors[] = [
137-
// identifier: isset.variable
138-
'message' => '#^Variable \\$newrow in isset\\(\\) always exists and is not nullable\\.$#',
139-
'count' => 1,
140-
'path' => __DIR__ . '/../../../src/wp-includes/general-template.php',
141-
];
142-
$ignoreErrors[] = [
143-
// identifier: isset.variable
144-
'message' => '#^Variable \\$user_already_exists in isset\\(\\) always exists and is not nullable\\.$#',
145-
'count' => 1,
146-
'path' => __DIR__ . '/../../../src/wp-includes/ms-functions.php',
147-
];
148-
$ignoreErrors[] = [
149-
// identifier: empty.variable
15059
'message' => '#^Variable \\$deprecated in empty\\(\\) always exists and is always falsy\\.$#',
60+
'identifier' => 'empty.variable',
15161
'count' => 1,
15262
'path' => __DIR__ . '/../../../src/wp-includes/pluggable.php',
15363
];
15464
$ignoreErrors[] = [
155-
// identifier: empty.variable
156-
'message' => '#^Variable \\$schema in empty\\(\\) is never defined\\.$#',
65+
'message' => '#^Variable \\$the_parent in empty\\(\\) always exists and is not falsy\\.$#',
66+
'identifier' => 'empty.variable',
15767
'count' => 1,
158-
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php',
159-
];
160-
$ignoreErrors[] = [
161-
// identifier: isset.variable
162-
'message' => '#^Variable \\$default in isset\\(\\) always exists and is not nullable\\.$#',
163-
'count' => 2,
16468
'path' => __DIR__ . '/../../../src/wp-includes/taxonomy.php',
16569
];
16670
$ignoreErrors[] = [
167-
// identifier: isset.variable
16871
'message' => '#^Variable \\$s in isset\\(\\) is never defined\\.$#',
72+
'identifier' => 'isset.variable',
16973
'count' => 1,
17074
'path' => __DIR__ . '/../../../src/wp-includes/template.php',
17175
];
172-
$ignoreErrors[] = [
173-
// identifier: empty.variable
174-
'message' => '#^Variable \\$old_user_data in empty\\(\\) always exists and is not falsy\\.$#',
175-
'count' => 1,
176-
'path' => __DIR__ . '/../../../src/wp-includes/user.php',
177-
];
17876

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

0 commit comments

Comments
 (0)