Skip to content

Commit d949a94

Browse files
committed
chore: regenerate PHPStan baselines
1 parent 0e2d031 commit d949a94

File tree

6 files changed

+88
-1492
lines changed

6 files changed

+88
-1492
lines changed

tests/phpstan/baseline/level-0.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
'count' => 1,
1414
'path' => __DIR__ . '/../../../src/wp-admin/press-this.php',
1515
];
16+
$ignoreErrors[] = [
17+
// identifier: return.missing
18+
'message' => '#^Method WP_Theme_JSON\\:\\:should_override_preset\\(\\) should return bool but return statement is missing\\.$#',
19+
'count' => 1,
20+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-theme-json.php',
21+
];
1622
$ignoreErrors[] = [
1723
// identifier: return.missing
1824
'message' => '#^Method WP_Customize_Background_Image_Setting\\:\\:update\\(\\) should return bool but return statement is missing\\.$#',
@@ -37,6 +43,12 @@
3743
'count' => 1,
3844
'path' => __DIR__ . '/../../../src/wp-includes/media.php',
3945
];
46+
$ignoreErrors[] = [
47+
// identifier: function.nameCase
48+
'message' => '#^Call to function get_current_user_id\\(\\) with incorrect case\\: get_current_user_ID$#',
49+
'count' => 1,
50+
'path' => __DIR__ . '/../../../src/wp-includes/script-loader.php',
51+
];
4052
$ignoreErrors[] = [
4153
// identifier: new.static
4254
'message' => '#^Unsafe usage of new static\\(\\)\\.$#',

tests/phpstan/baseline/level-1.php

Lines changed: 0 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
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-
];
3428
$ignoreErrors[] = [
3529
// identifier: isset.variable
3630
'message' => '#^Variable \\$_POST in isset\\(\\) always exists and is not nullable\\.$#',
@@ -49,24 +43,12 @@
4943
'count' => 1,
5044
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-direct.php',
5145
];
52-
$ignoreErrors[] = [
53-
// identifier: isset.variable
54-
'message' => '#^Variable \\$children_pages in isset\\(\\) is never defined\\.$#',
55-
'count' => 1,
56-
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-posts-list-table.php',
57-
];
5846
$ignoreErrors[] = [
5947
// identifier: empty.variable
6048
'message' => '#^Variable \\$class in empty\\(\\) always exists and is always falsy\\.$#',
6149
'count' => 1,
6250
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-posts-list-table.php',
6351
];
64-
$ignoreErrors[] = [
65-
// identifier: empty.variable
66-
'message' => '#^Variable \\$theme in empty\\(\\) always exists and is not falsy\\.$#',
67-
'count' => 2,
68-
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-theme-install-list-table.php',
69-
];
7052
$ignoreErrors[] = [
7153
// identifier: empty.variable
7254
'message' => '#^Variable \\$connection_type in empty\\(\\) always exists and is not falsy\\.$#',
@@ -79,24 +61,6 @@
7961
'count' => 1,
8062
'path' => __DIR__ . '/../../../src/wp-admin/includes/media.php',
8163
];
82-
$ignoreErrors[] = [
83-
// identifier: empty.variable
84-
'message' => '#^Variable \\$callback in empty\\(\\) always exists and is not falsy\\.$#',
85-
'count' => 2,
86-
'path' => __DIR__ . '/../../../src/wp-admin/includes/plugin.php',
87-
];
88-
$ignoreErrors[] = [
89-
// identifier: empty.variable
90-
'message' => '#^Variable \\$load in empty\\(\\) always exists and is not falsy\\.$#',
91-
'count' => 1,
92-
'path' => __DIR__ . '/../../../src/wp-admin/load-scripts.php',
93-
];
94-
$ignoreErrors[] = [
95-
// identifier: empty.variable
96-
'message' => '#^Variable \\$load in empty\\(\\) always exists and is not falsy\\.$#',
97-
'count' => 1,
98-
'path' => __DIR__ . '/../../../src/wp-admin/load-styles.php',
99-
];
10064
$ignoreErrors[] = [
10165
// identifier: empty.variable
10266
'message' => '#^Variable \\$parent_file in empty\\(\\) always exists and is not falsy\\.$#',
@@ -121,60 +85,24 @@
12185
'count' => 2,
12286
'path' => __DIR__ . '/../../../src/wp-includes/capabilities.php',
12387
];
124-
$ignoreErrors[] = [
125-
// identifier: isset.variable
126-
'message' => '#^Variable \\$block in isset\\(\\) always exists and is not nullable\\.$#',
127-
'count' => 1,
128-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-list.php',
129-
];
13088
$ignoreErrors[] = [
13189
// identifier: isset.variable
13290
'message' => '#^Variable \\$namespace in isset\\(\\) always exists and is not nullable\\.$#',
13391
'count' => 1,
13492
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-parser.php',
13593
];
136-
$ignoreErrors[] = [
137-
// identifier: isset.variable
138-
'message' => '#^Variable \\$category_name in isset\\(\\) always exists and is not nullable\\.$#',
139-
'count' => 1,
140-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-pattern-categories-registry.php',
141-
];
142-
$ignoreErrors[] = [
143-
// identifier: isset.variable
144-
'message' => '#^Variable \\$pattern_name in isset\\(\\) always exists and is not nullable\\.$#',
145-
'count' => 1,
146-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-patterns-registry.php',
147-
];
14894
$ignoreErrors[] = [
14995
// identifier: empty.variable
15096
'message' => '#^Variable \\$block_type in empty\\(\\) always exists and is not falsy\\.$#',
15197
'count' => 1,
15298
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-supports.php',
15399
];
154-
$ignoreErrors[] = [
155-
// identifier: empty.variable
156-
'message' => '#^Variable \\$q_values in empty\\(\\) always exists and is not falsy\\.$#',
157-
'count' => 1,
158-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-comment-query.php',
159-
];
160100
$ignoreErrors[] = [
161101
// identifier: empty.variable
162102
'message' => '#^Variable \\$status_clauses in empty\\(\\) always exists and is not falsy\\.$#',
163103
'count' => 1,
164104
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-comment-query.php',
165105
];
166-
$ignoreErrors[] = [
167-
// identifier: isset.variable
168-
'message' => '#^Variable \\$root in isset\\(\\) always exists and is not nullable\\.$#',
169-
'count' => 2,
170-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-customize-setting.php',
171-
];
172-
$ignoreErrors[] = [
173-
// identifier: isset.variable
174-
'message' => '#^Variable \\$value in isset\\(\\) always exists and is not nullable\\.$#',
175-
'count' => 1,
176-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-date-query.php',
177-
];
178106
$ignoreErrors[] = [
179107
// identifier: constructor.unusedParameter
180108
'message' => '#^Constructor of class WP_Feed_Cache_Transient has an unused parameter \\$location\\.$#',
@@ -211,54 +139,18 @@
211139
'count' => 1,
212140
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-query.php',
213141
];
214-
$ignoreErrors[] = [
215-
// identifier: empty.variable
216-
'message' => '#^Variable \\$inner in empty\\(\\) always exists and is always falsy\\.$#',
217-
'count' => 1,
218-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-theme-json.php',
219-
];
220142
$ignoreErrors[] = [
221143
// identifier: empty.variable
222144
'message' => '#^Variable \\$modes_str in empty\\(\\) always exists and is not falsy\\.$#',
223145
'count' => 1,
224146
'path' => __DIR__ . '/../../../src/wp-includes/class-wpdb.php',
225147
];
226-
$ignoreErrors[] = [
227-
// identifier: empty.variable
228-
'message' => '#^Variable \\$posts in empty\\(\\) always exists and is not falsy\\.$#',
229-
'count' => 1,
230-
'path' => __DIR__ . '/../../../src/wp-includes/comment.php',
231-
];
232148
$ignoreErrors[] = [
233149
// identifier: isset.variable
234150
'message' => '#^Variable \\$newrow in isset\\(\\) always exists and is not nullable\\.$#',
235151
'count' => 1,
236152
'path' => __DIR__ . '/../../../src/wp-includes/general-template.php',
237153
];
238-
$ignoreErrors[] = [
239-
// identifier: isset.variable
240-
'message' => '#^Variable \\$character_reference in isset\\(\\) always exists and is not nullable\\.$#',
241-
'count' => 1,
242-
'path' => __DIR__ . '/../../../src/wp-includes/html-api/class-wp-html-decoder.php',
243-
];
244-
$ignoreErrors[] = [
245-
// identifier: isset.variable
246-
'message' => '#^Variable \\$replacement in isset\\(\\) always exists and is not nullable\\.$#',
247-
'count' => 1,
248-
'path' => __DIR__ . '/../../../src/wp-includes/html-api/class-wp-html-tag-processor.php',
249-
];
250-
$ignoreErrors[] = [
251-
// identifier: empty.variable
252-
'message' => '#^Variable \\$attachment in empty\\(\\) always exists and is not falsy\\.$#',
253-
'count' => 1,
254-
'path' => __DIR__ . '/../../../src/wp-includes/media.php',
255-
];
256-
$ignoreErrors[] = [
257-
// identifier: isset.variable
258-
'message' => '#^Variable \\$file_info in isset\\(\\) always exists and is not nullable\\.$#',
259-
'count' => 1,
260-
'path' => __DIR__ . '/../../../src/wp-includes/media.php',
261-
];
262154
$ignoreErrors[] = [
263155
// identifier: isset.variable
264156
'message' => '#^Variable \\$user_already_exists in isset\\(\\) always exists and is not nullable\\.$#',
@@ -271,48 +163,12 @@
271163
'count' => 1,
272164
'path' => __DIR__ . '/../../../src/wp-includes/pluggable.php',
273165
];
274-
$ignoreErrors[] = [
275-
// identifier: empty.variable
276-
'message' => '#^Variable \\$tempheaders in empty\\(\\) always exists and is not falsy\\.$#',
277-
'count' => 1,
278-
'path' => __DIR__ . '/../../../src/wp-includes/pluggable.php',
279-
];
280-
$ignoreErrors[] = [
281-
// identifier: isset.variable
282-
'message' => '#^Variable \\$wp_actions in isset\\(\\) always exists and is not nullable\\.$#',
283-
'count' => 1,
284-
'path' => __DIR__ . '/../../../src/wp-includes/plugin.php',
285-
];
286-
$ignoreErrors[] = [
287-
// identifier: isset.variable
288-
'message' => '#^Variable \\$wp_current_filter in isset\\(\\) always exists and is not nullable\\.$#',
289-
'count' => 1,
290-
'path' => __DIR__ . '/../../../src/wp-includes/plugin.php',
291-
];
292-
$ignoreErrors[] = [
293-
// identifier: isset.variable
294-
'message' => '#^Variable \\$wp_filters in isset\\(\\) always exists and is not nullable\\.$#',
295-
'count' => 1,
296-
'path' => __DIR__ . '/../../../src/wp-includes/plugin.php',
297-
];
298166
$ignoreErrors[] = [
299167
// identifier: empty.variable
300168
'message' => '#^Variable \\$schema in empty\\(\\) is never defined\\.$#',
301169
'count' => 1,
302170
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php',
303171
];
304-
$ignoreErrors[] = [
305-
// identifier: empty.variable
306-
'message' => '#^Variable \\$prepared_term in empty\\(\\) always exists and is not falsy\\.$#',
307-
'count' => 1,
308-
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php',
309-
];
310-
$ignoreErrors[] = [
311-
// identifier: empty.variable
312-
'message' => '#^Variable \\$prepared_term in empty\\(\\) always exists and is not falsy\\.$#',
313-
'count' => 1,
314-
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php',
315-
];
316172
$ignoreErrors[] = [
317173
// identifier: isset.variable
318174
'message' => '#^Variable \\$default in isset\\(\\) always exists and is not nullable\\.$#',
@@ -325,12 +181,6 @@
325181
'count' => 1,
326182
'path' => __DIR__ . '/../../../src/wp-includes/taxonomy.php',
327183
];
328-
$ignoreErrors[] = [
329-
// identifier: empty.variable
330-
'message' => '#^Variable \\$the_parent in empty\\(\\) always exists and is not falsy\\.$#',
331-
'count' => 1,
332-
'path' => __DIR__ . '/../../../src/wp-includes/taxonomy.php',
333-
];
334184
$ignoreErrors[] = [
335185
// identifier: isset.variable
336186
'message' => '#^Variable \\$s in isset\\(\\) is never defined\\.$#',
@@ -343,29 +193,5 @@
343193
'count' => 1,
344194
'path' => __DIR__ . '/../../../src/wp-includes/user.php',
345195
];
346-
$ignoreErrors[] = [
347-
// identifier: empty.variable
348-
'message' => '#^Variable \\$control_callback in empty\\(\\) always exists and is not falsy\\.$#',
349-
'count' => 1,
350-
'path' => __DIR__ . '/../../../src/wp-includes/widgets.php',
351-
];
352-
$ignoreErrors[] = [
353-
// identifier: empty.variable
354-
'message' => '#^Variable \\$form_callback in empty\\(\\) always exists and is not falsy\\.$#',
355-
'count' => 1,
356-
'path' => __DIR__ . '/../../../src/wp-includes/widgets.php',
357-
];
358-
$ignoreErrors[] = [
359-
// identifier: empty.variable
360-
'message' => '#^Variable \\$output_callback in empty\\(\\) always exists and is not falsy\\.$#',
361-
'count' => 1,
362-
'path' => __DIR__ . '/../../../src/wp-includes/widgets.php',
363-
];
364-
$ignoreErrors[] = [
365-
// identifier: empty.variable
366-
'message' => '#^Variable \\$update_callback in empty\\(\\) always exists and is not falsy\\.$#',
367-
'count' => 1,
368-
'path' => __DIR__ . '/../../../src/wp-includes/widgets.php',
369-
];
370196

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

tests/phpstan/baseline/level-2.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@
139139
'count' => 2,
140140
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-language-pack-upgrader.php',
141141
];
142+
$ignoreErrors[] = [
143+
// identifier: method.nameCase
144+
'message' => '#^Call to method WP_Theme\\:\\:get\\(\\) with incorrect case\\: Get$#',
145+
'count' => 1,
146+
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-language-pack-upgrader.php',
147+
];
142148
$ignoreErrors[] = [
143149
// identifier: property.notFound
144150
'message' => '#^Access to an undefined property WP_Upgrader\\:\\:\\$new_plugin_data\\.$#',
@@ -355,6 +361,12 @@
355361
'count' => 1,
356362
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-walker-nav-menu-edit.php',
357363
];
364+
$ignoreErrors[] = [
365+
// identifier: method.nameCase
366+
'message' => '#^Call to method WP_Theme\\:\\:get\\(\\) with incorrect case\\: Get$#',
367+
'count' => 1,
368+
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-automatic-updater.php',
369+
];
358370
$ignoreErrors[] = [
359371
// identifier: property.nonObject
360372
'message' => '#^Cannot access property \\$current on array\\|object\\.$#',
@@ -421,6 +433,12 @@
421433
'count' => 1,
422434
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-ftpext.php',
423435
];
436+
$ignoreErrors[] = [
437+
// identifier: method.nameCase
438+
'message' => '#^Call to method ftp_base\\:\\:SetTimeout\\(\\) with incorrect case\\: setTimeout$#',
439+
'count' => 2,
440+
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-ftpsockets.php',
441+
];
424442
$ignoreErrors[] = [
425443
// identifier: parameter.defaultValue
426444
'message' => '#^Default value of the parameter \\#1 \\$opt \\(string\\) of method WP_Filesystem_ftpsockets\\:\\:__construct\\(\\) is incompatible with type array\\.$#',
@@ -1513,6 +1531,18 @@
15131531
'count' => 3,
15141532
'path' => __DIR__ . '/../../../src/wp-includes/nav-menu.php',
15151533
];
1534+
$ignoreErrors[] = [
1535+
// identifier: method.nameCase
1536+
'message' => '#^Call to method PHPMailer\\\\PHPMailer\\\\PHPMailer\\:\\:addBCC\\(\\) with incorrect case\\: addBcc$#',
1537+
'count' => 1,
1538+
'path' => __DIR__ . '/../../../src/wp-includes/pluggable.php',
1539+
];
1540+
$ignoreErrors[] = [
1541+
// identifier: method.nameCase
1542+
'message' => '#^Call to method PHPMailer\\\\PHPMailer\\\\PHPMailer\\:\\:addCC\\(\\) with incorrect case\\: addCc$#',
1543+
'count' => 1,
1544+
'path' => __DIR__ . '/../../../src/wp-includes/pluggable.php',
1545+
];
15161546
$ignoreErrors[] = [
15171547
// identifier: property.notFound
15181548
'message' => '#^Access to an undefined property object\\:\\:\\$name\\.$#',

tests/phpstan/baseline/level-3.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,12 @@
625625
'count' => 1,
626626
'path' => __DIR__ . '/../../../src/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php',
627627
];
628+
$ignoreErrors[] = [
629+
// identifier: return.type
630+
'message' => '#^Method WP_Customize_Nav_Menu_Setting\\:\\:filter_wp_get_nav_menu_object\\(\\) should return object\\|null but returns false\\.$#',
631+
'count' => 1,
632+
'path' => __DIR__ . '/../../../src/wp-includes/customize/class-wp-customize-nav-menu-setting.php',
633+
];
628634
$ignoreErrors[] = [
629635
// identifier: property.phpDocType
630636
'message' => '#^PHPDoc type array of property WP_Customize_Nav_Menu_Setting\\:\\:\\$default is not covariant with PHPDoc type string of overridden property WP_Customize_Setting\\:\\:\\$default\\.$#',

0 commit comments

Comments
 (0)