Skip to content

Commit 9d8fada

Browse files
committed
chore: regenerate PHPStan Baselines after rebase
1 parent 1905165 commit 9d8fada

6 files changed

Lines changed: 122 additions & 80 deletions

File tree

tests/phpstan/baseline/level-1.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@
5555
'count' => 1,
5656
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-direct.php',
5757
];
58-
$ignoreErrors[] = [
59-
'message' => '#^Variable \\$class in empty\\(\\) always exists and is not falsy\\.$#',
60-
'identifier' => 'empty.variable',
61-
'count' => 1,
62-
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-list-table.php',
63-
];
6458
$ignoreErrors[] = [
6559
'message' => '#^Variable \\$children_pages in isset\\(\\) is never defined\\.$#',
6660
'identifier' => 'isset.variable',
@@ -187,18 +181,6 @@
187181
'count' => 1,
188182
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-date-query.php',
189183
];
190-
$ignoreErrors[] = [
191-
'message' => '#^Constructor of class WP_Feed_Cache_Transient has an unused parameter \\$location\\.$#',
192-
'identifier' => 'constructor.unusedParameter',
193-
'count' => 1,
194-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-feed-cache-transient.php',
195-
];
196-
$ignoreErrors[] = [
197-
'message' => '#^Constructor of class WP_Feed_Cache_Transient has an unused parameter \\$type\\.$#',
198-
'identifier' => 'constructor.unusedParameter',
199-
'count' => 1,
200-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-feed-cache-transient.php',
201-
];
202184
$ignoreErrors[] = [
203185
'message' => '#^Variable \\$loader in isset\\(\\) always exists and is not nullable\\.$#',
204186
'identifier' => 'isset.variable',
@@ -271,12 +253,6 @@
271253
'count' => 1,
272254
'path' => __DIR__ . '/../../../src/wp-includes/media.php',
273255
];
274-
$ignoreErrors[] = [
275-
'message' => '#^Variable \\$user_already_exists in isset\\(\\) always exists and is not nullable\\.$#',
276-
'identifier' => 'isset.variable',
277-
'count' => 1,
278-
'path' => __DIR__ . '/../../../src/wp-includes/ms-functions.php',
279-
];
280256
$ignoreErrors[] = [
281257
'message' => '#^Variable \\$deprecated in empty\\(\\) always exists and is always falsy\\.$#',
282258
'identifier' => 'empty.variable',
@@ -307,12 +283,6 @@
307283
'count' => 1,
308284
'path' => __DIR__ . '/../../../src/wp-includes/plugin.php',
309285
];
310-
$ignoreErrors[] = [
311-
'message' => '#^Variable \\$last_error_code in empty\\(\\) always exists and is not falsy\\.$#',
312-
'identifier' => 'empty.variable',
313-
'count' => 1,
314-
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/class-wp-rest-server.php',
315-
];
316286
$ignoreErrors[] = [
317287
'message' => '#^Variable \\$schema in empty\\(\\) is never defined\\.$#',
318288
'identifier' => 'empty.variable',

tests/phpstan/baseline/level-2.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,12 @@
655655
'count' => 1,
656656
'path' => __DIR__ . '/../../../src/wp-admin/profile.php',
657657
];
658+
$ignoreErrors[] = [
659+
'message' => '#^Access to an undefined property WP_Theme\\:\\:\\$version\\.$#',
660+
'identifier' => 'property.notFound',
661+
'count' => 1,
662+
'path' => __DIR__ . '/../../../src/wp-admin/update-core.php',
663+
];
658664
$ignoreErrors[] = [
659665
'message' => '#^Cannot access property \\$download_link on array\\|object\\.$#',
660666
'identifier' => 'property.nonObject',
@@ -985,12 +991,6 @@
985991
'count' => 1,
986992
'path' => __DIR__ . '/../../../src/wp-includes/comment.php',
987993
];
988-
$ignoreErrors[] = [
989-
'message' => '#^Comparison operation "\\=\\=" between 0 and array\\|int results in an error\\.$#',
990-
'identifier' => 'equal.invalid',
991-
'count' => 1,
992-
'path' => __DIR__ . '/../../../src/wp-includes/comment.php',
993-
];
994994
$ignoreErrors[] = [
995995
'message' => '#^Cannot access property \\$term_id on string\\|WP_Customize_Setting\\.$#',
996996
'identifier' => 'property.nonObject',
@@ -1111,12 +1111,6 @@
11111111
'count' => 1,
11121112
'path' => __DIR__ . '/../../../src/wp-includes/link-template.php',
11131113
];
1114-
$ignoreErrors[] = [
1115-
'message' => '#^Default value of the parameter \\#1 \\$force \\(string\\) of function force_ssl_content\\(\\) is incompatible with type bool\\.$#',
1116-
'identifier' => 'parameter.defaultValue',
1117-
'count' => 1,
1118-
'path' => __DIR__ . '/../../../src/wp-includes/ms-functions.php',
1119-
];
11201114
$ignoreErrors[] = [
11211115
'message' => '#^Cannot access property \\$ID on array\\|object\\.$#',
11221116
'identifier' => 'property.nonObject',

tests/phpstan/baseline/level-3.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
'count' => 2,
88
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-automatic-updater.php',
99
];
10+
$ignoreErrors[] = [
11+
'message' => '#^Cannot access offset \'new_version\' on bool\\.$#',
12+
'identifier' => 'offsetAccess.nonOffsetAccessible',
13+
'count' => 4,
14+
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-debug-data.php',
15+
];
1016
$ignoreErrors[] = [
1117
'message' => '#^Method WP_Filesystem_Direct\\:\\:group\\(\\) should return string\\|false but returns int\\<min, \\-1\\>\\|int\\<1, max\\>\\.$#',
1218
'identifier' => 'return.type',
@@ -133,6 +139,12 @@
133139
'count' => 2,
134140
'path' => __DIR__ . '/../../../src/wp-admin/includes/theme.php',
135141
];
142+
$ignoreErrors[] = [
143+
'message' => '#^Cannot access offset \'new_version\' on bool\\.$#',
144+
'identifier' => 'offsetAccess.nonOffsetAccessible',
145+
'count' => 1,
146+
'path' => __DIR__ . '/../../../src/wp-admin/update-core.php',
147+
];
136148
$ignoreErrors[] = [
137149
'message' => '#^Function get_the_author_posts\\(\\) should return int but returns string\\.$#',
138150
'identifier' => 'return.type',

tests/phpstan/baseline/level-4.php

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,12 @@
331331
'count' => 1,
332332
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-list-table.php',
333333
];
334+
$ignoreErrors[] = [
335+
'message' => '#^Offset \'post_status\' on non\\-empty\\-array in isset\\(\\) always exists and is not nullable\\.$#',
336+
'identifier' => 'isset.offset',
337+
'count' => 1,
338+
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-list-table.php',
339+
];
334340
$ignoreErrors[] = [
335341
'message' => '#^Property WP_List_Table\\:\\:\\$_column_headers \\(array\\) in isset\\(\\) is not nullable\\.$#',
336342
'identifier' => 'isset.property',
@@ -427,6 +433,12 @@
427433
'count' => 1,
428434
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-privacy-requests-table.php',
429435
];
436+
$ignoreErrors[] = [
437+
'message' => '#^Offset \'filter\\-status\' on non\\-empty\\-array in isset\\(\\) always exists and is not nullable\\.$#',
438+
'identifier' => 'isset.offset',
439+
'count' => 1,
440+
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-privacy-requests-table.php',
441+
];
430442
$ignoreErrors[] = [
431443
'message' => '#^Call to function is_bool\\(\\) with bool will always evaluate to true\\.$#',
432444
'identifier' => 'function.alreadyNarrowedType',
@@ -1051,6 +1063,12 @@
10511063
'count' => 1,
10521064
'path' => __DIR__ . '/../../../src/wp-admin/nav-menus.php',
10531065
];
1066+
$ignoreErrors[] = [
1067+
'message' => '#^Offset \'action\' on non\\-empty\\-array in isset\\(\\) always exists and is not nullable\\.$#',
1068+
'identifier' => 'isset.offset',
1069+
'count' => 1,
1070+
'path' => __DIR__ . '/../../../src/wp-admin/nav-menus.php',
1071+
];
10541072
$ignoreErrors[] = [
10551073
'message' => '#^Offset \\(float\\|int\\) on array\\<mixed\\> in isset\\(\\) always exists and is not nullable\\.$#',
10561074
'identifier' => 'isset.offset',
@@ -1081,6 +1099,12 @@
10811099
'count' => 1,
10821100
'path' => __DIR__ . '/../../../src/wp-admin/plugins.php',
10831101
];
1102+
$ignoreErrors[] = [
1103+
'message' => '#^Offset \'checked\' on non\\-empty\\-array in isset\\(\\) always exists and is not nullable\\.$#',
1104+
'identifier' => 'isset.offset',
1105+
'count' => 1,
1106+
'path' => __DIR__ . '/../../../src/wp-admin/plugins.php',
1107+
];
10841108
$ignoreErrors[] = [
10851109
'message' => '#^Negated boolean expression is always true\\.$#',
10861110
'identifier' => 'booleanNot.alwaysTrue',
@@ -1340,7 +1364,7 @@
13401364
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-list.php',
13411365
];
13421366
$ignoreErrors[] = [
1343-
'message' => '#^Offset \'closer\' on array\\{0\\: array\\{string, int\\<\\-1, max\\>\\}, closer\\: array\\{\'\'\\|\'/\', int\\<\\-1, max\\>\\}, 1\\: array\\{\'\'\\|\'/\', int\\<\\-1, max\\>\\}, namespace\\: array\\{string, int\\<\\-1, max\\>\\}, 2\\: array\\{string, int\\<\\-1, max\\>\\}, name\\: array\\{non\\-falsy\\-string, int\\<\\-1, max\\>\\}, 3\\: array\\{non\\-falsy\\-string, int\\<\\-1, max\\>\\}, attrs\\?\\: array\\{string, int\\<\\-1, max\\>\\}, \\.\\.\\.\\} in isset\\(\\) always exists and is not nullable\\.$#',
1367+
'message' => '#^Offset \'closer\' on array\\{0\\: array\\{non\\-falsy\\-string, int\\<\\-1, max\\>\\}, closer\\: array\\{\'\'\\|\'/\', int\\<\\-1, max\\>\\}, 1\\: array\\{\'\'\\|\'/\', int\\<\\-1, max\\>\\}, namespace\\: array\\{string, int\\<\\-1, max\\>\\}, 2\\: array\\{string, int\\<\\-1, max\\>\\}, name\\: array\\{non\\-falsy\\-string, int\\<\\-1, max\\>\\}, 3\\: array\\{non\\-falsy\\-string, int\\<\\-1, max\\>\\}, attrs\\?\\: array\\{string, int\\<\\-1, max\\>\\}, \\.\\.\\.\\} in isset\\(\\) always exists and is not nullable\\.$#',
13441368
'identifier' => 'isset.offset',
13451369
'count' => 1,
13461370
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-parser.php',
@@ -1927,6 +1951,12 @@
19271951
'count' => 1,
19281952
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-query.php',
19291953
];
1954+
$ignoreErrors[] = [
1955+
'message' => '#^Property WP_Post\\:\\:\\$ID \\(int\\) in isset\\(\\) is not nullable\\.$#',
1956+
'identifier' => 'isset.property',
1957+
'count' => 1,
1958+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-query.php',
1959+
];
19301960
$ignoreErrors[] = [
19311961
'message' => '#^Property WP_Query\\:\\:\\$queried_object_id \\(int\\) in isset\\(\\) is not nullable\\.$#',
19321962
'identifier' => 'isset.property',
@@ -2810,7 +2840,7 @@
28102840
'path' => __DIR__ . '/../../../src/wp-includes/formatting.php',
28112841
];
28122842
$ignoreErrors[] = [
2813-
'message' => '#^Offset 0 on array\\{0\\: string, non_cdata_followed_by_cdata\\: \'\', 1\\: \'\', 2\\: \'\', cdata\\: \'\', 3\\: \'\', 4\\: \'\', non_cdata\\: string, \\.\\.\\.\\}\\|array\\{0\\: string, non_cdata_followed_by_cdata\\: string, 1\\: string, 2\\: string, cdata\\: non\\-falsy\\-string, 3\\: non\\-falsy\\-string, 4\\: non\\-falsy\\-string\\} in isset\\(\\) always exists and is not nullable\\.$#',
2843+
'message' => '#^Offset 0 on array\\{0\\: non\\-empty\\-string, non_cdata_followed_by_cdata\\: \'\', 1\\: \'\', 2\\: \'\', cdata\\: \'\', 3\\: \'\', 4\\: \'\', non_cdata\\: string, \\.\\.\\.\\}\\|array\\{0\\: non\\-empty\\-string, non_cdata_followed_by_cdata\\: string, 1\\: string, 2\\: string, cdata\\: non\\-falsy\\-string, 3\\: non\\-falsy\\-string, 4\\: non\\-falsy\\-string\\} in isset\\(\\) always exists and is not nullable\\.$#',
28142844
'identifier' => 'isset.offset',
28152845
'count' => 1,
28162846
'path' => __DIR__ . '/../../../src/wp-includes/formatting.php',
@@ -3319,6 +3349,12 @@
33193349
'count' => 1,
33203350
'path' => __DIR__ . '/../../../src/wp-includes/ms-blogs.php',
33213351
];
3352+
$ignoreErrors[] = [
3353+
'message' => '#^Offset \'_wp_switched_stack\' on non\\-empty\\-array in empty\\(\\) always exists and is not falsy\\.$#',
3354+
'identifier' => 'empty.offset',
3355+
'count' => 2,
3356+
'path' => __DIR__ . '/../../../src/wp-includes/ms-blogs.php',
3357+
];
33223358
$ignoreErrors[] = [
33233359
'message' => '#^Strict comparison using \\!\\=\\= between null and null will always evaluate to false\\.$#',
33243360
'identifier' => 'notIdentical.alwaysFalse',
@@ -3367,12 +3403,6 @@
33673403
'count' => 1,
33683404
'path' => __DIR__ . '/../../../src/wp-includes/ms-functions.php',
33693405
];
3370-
$ignoreErrors[] = [
3371-
'message' => '#^Unreachable statement \\- code above always terminates\\.$#',
3372-
'identifier' => 'deadCode.unreachable',
3373-
'count' => 1,
3374-
'path' => __DIR__ . '/../../../src/wp-includes/ms-functions.php',
3375-
];
33763406
$ignoreErrors[] = [
33773407
'message' => '#^Strict comparison using \\!\\=\\= between \'%%siteurl%%\' and \'\' will always evaluate to true\\.$#',
33783408
'identifier' => 'notIdentical.alwaysTrue',

tests/phpstan/baseline/level-5.php

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@
4949
'count' => 5,
5050
'path' => __DIR__ . '/../../../src/wp-admin/edit-comments.php',
5151
];
52+
$ignoreErrors[] = [
53+
'message' => '#^Parameter \\#2 \\$gmt of function current_time expects bool, int given\\.$#',
54+
'identifier' => 'argument.type',
55+
'count' => 1,
56+
'path' => __DIR__ . '/../../../src/wp-admin/edit-comments.php',
57+
];
5258
$ignoreErrors[] = [
5359
'message' => '#^Parameter \\#1 \\$screen of function do_meta_boxes expects string\\|WP_Screen, null given\\.$#',
5460
'identifier' => 'argument.type',
@@ -139,6 +145,12 @@
139145
'count' => 1,
140146
'path' => __DIR__ . '/../../../src/wp-admin/includes/ajax-actions.php',
141147
];
148+
$ignoreErrors[] = [
149+
'message' => '#^Parameter \\#2 \\$gmt of function current_time expects bool, int given\\.$#',
150+
'identifier' => 'argument.type',
151+
'count' => 1,
152+
'path' => __DIR__ . '/../../../src/wp-admin/includes/bookmark.php',
153+
];
142154
$ignoreErrors[] = [
143155
'message' => '#^Parameter \\#2 \\$allowed_html of function wp_kses expects array\\<array\\>\\|string, array\\<string, array\\<string, bool\\>\\|true\\> given\\.$#',
144156
'identifier' => 'argument.type',
@@ -475,6 +487,12 @@
475487
'count' => 1,
476488
'path' => __DIR__ . '/../../../src/wp-admin/includes/image-edit.php',
477489
];
490+
$ignoreErrors[] = [
491+
'message' => '#^Parameter \\#1 \\$text of function esc_attr expects string, int given\\.$#',
492+
'identifier' => 'argument.type',
493+
'count' => 2,
494+
'path' => __DIR__ . '/../../../src/wp-admin/includes/image-edit.php',
495+
];
478496
$ignoreErrors[] = [
479497
'message' => '#^Parameter \\#1 \\$width of function wp_imagecreatetruecolor expects int, float given\\.$#',
480498
'identifier' => 'argument.type',
@@ -685,6 +703,12 @@
685703
'count' => 1,
686704
'path' => __DIR__ . '/../../../src/wp-admin/includes/upgrade.php',
687705
];
706+
$ignoreErrors[] = [
707+
'message' => '#^Parameter \\#2 \\$gmt of function current_time expects bool, int given\\.$#',
708+
'identifier' => 'argument.type',
709+
'count' => 1,
710+
'path' => __DIR__ . '/../../../src/wp-admin/includes/upgrade.php',
711+
];
688712
$ignoreErrors[] = [
689713
'message' => '#^Parameter \\#3 \\$deprecated of function add_option expects string, null given\\.$#',
690714
'identifier' => 'argument.type',
@@ -1183,6 +1207,12 @@
11831207
'count' => 1,
11841208
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-xmlrpc-server.php',
11851209
];
1210+
$ignoreErrors[] = [
1211+
'message' => '#^Parameter \\#2 \\$gmt of function current_time expects bool, int given\\.$#',
1212+
'identifier' => 'argument.type',
1213+
'count' => 1,
1214+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-xmlrpc-server.php',
1215+
];
11861216
$ignoreErrors[] = [
11871217
'message' => '#^Parameter \\#2 \\$arrays of function array_intersect expects an array of values castable to string, array\\<string\\|WP_Post_Type\\> given\\.$#',
11881218
'identifier' => 'argument.type',
@@ -1273,6 +1303,12 @@
12731303
'count' => 2,
12741304
'path' => __DIR__ . '/../../../src/wp-includes/comment.php',
12751305
];
1306+
$ignoreErrors[] = [
1307+
'message' => '#^Parameter \\#2 \\$gmt of function current_time expects bool, int given\\.$#',
1308+
'identifier' => 'argument.type',
1309+
'count' => 1,
1310+
'path' => __DIR__ . '/../../../src/wp-includes/comment.php',
1311+
];
12761312
$ignoreErrors[] = [
12771313
'message' => '#^Parameter \\#2 \\$object_ids of function update_meta_cache expects array\\<int\\>\\|string, list\\<string\\> given\\.$#',
12781314
'identifier' => 'argument.type',
@@ -1525,36 +1561,6 @@
15251561
'count' => 1,
15261562
'path' => __DIR__ . '/../../../src/wp-includes/nav-menu.php',
15271563
];
1528-
$ignoreErrors[] = [
1529-
'message' => '#^Parameter \\#1 \\$network_id of function add_network_option expects int, null given\\.$#',
1530-
'identifier' => 'argument.type',
1531-
'count' => 1,
1532-
'path' => __DIR__ . '/../../../src/wp-includes/option.php',
1533-
];
1534-
$ignoreErrors[] = [
1535-
'message' => '#^Parameter \\#1 \\$network_id of function delete_network_option expects int, null given\\.$#',
1536-
'identifier' => 'argument.type',
1537-
'count' => 1,
1538-
'path' => __DIR__ . '/../../../src/wp-includes/option.php',
1539-
];
1540-
$ignoreErrors[] = [
1541-
'message' => '#^Parameter \\#1 \\$network_id of function get_network_option expects int, null given\\.$#',
1542-
'identifier' => 'argument.type',
1543-
'count' => 1,
1544-
'path' => __DIR__ . '/../../../src/wp-includes/option.php',
1545-
];
1546-
$ignoreErrors[] = [
1547-
'message' => '#^Parameter \\#1 \\$network_id of function update_network_option expects int, null given\\.$#',
1548-
'identifier' => 'argument.type',
1549-
'count' => 1,
1550-
'path' => __DIR__ . '/../../../src/wp-includes/option.php',
1551-
];
1552-
$ignoreErrors[] = [
1553-
'message' => '#^Parameter \\#1 \\$network_id of function wp_prime_network_option_caches expects int, null given\\.$#',
1554-
'identifier' => 'argument.type',
1555-
'count' => 1,
1556-
'path' => __DIR__ . '/../../../src/wp-includes/option.php',
1557-
];
15581564
$ignoreErrors[] = [
15591565
'message' => '#^Parameter \\#2 \\$value of function setcookie expects string, int\\<1, max\\> given\\.$#',
15601566
'identifier' => 'argument.type',
@@ -1645,6 +1651,12 @@
16451651
'count' => 1,
16461652
'path' => __DIR__ . '/../../../src/wp-includes/post.php',
16471653
];
1654+
$ignoreErrors[] = [
1655+
'message' => '#^Parameter \\#2 \\$gmt of function current_time expects bool, int given\\.$#',
1656+
'identifier' => 'argument.type',
1657+
'count' => 1,
1658+
'path' => __DIR__ . '/../../../src/wp-includes/post.php',
1659+
];
16481660
$ignoreErrors[] = [
16491661
'message' => '#^Parameter \\#2 \\$object_id of function delete_metadata expects int, null given\\.$#',
16501662
'identifier' => 'argument.type',

0 commit comments

Comments
 (0)