Skip to content

Commit 79b737b

Browse files
committed
chore: regenerate baselines
1 parent 5ccfa1c commit 79b737b

File tree

8 files changed

+48
-86
lines changed

8 files changed

+48
-86
lines changed

phpstan.neon.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ includes:
99
- tests/phpstan/base.neon
1010
# The baseline file includes preexisting errors in the codebase that should be ignored.
1111
# https://phpstan.org/user-guide/baseline
12-
- tests/phpstan/baseline/level-0.php
12+
13+
- tests/phpstan/baseline.php # level 0.
1314
- tests/phpstan/baseline/level-1.php
1415
- tests/phpstan/baseline/level-2.php
1516
- tests/phpstan/baseline/level-3.php

tests/phpstan/baseline/level-0.php

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/phpstan/baseline/level-1.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,5 @@
121121
'count' => 1,
122122
'path' => __DIR__ . '/../../../src/wp-includes/template.php',
123123
];
124-
$ignoreErrors[] = [
125-
'message' => '#^Variable \\$old_user_data in empty\\(\\) always exists and is not falsy\\.$#',
126-
'identifier' => 'empty.variable',
127-
'count' => 1,
128-
'path' => __DIR__ . '/../../../src/wp-includes/user.php',
129-
];
130124

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

tests/phpstan/baseline/level-2.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,12 @@
397397
'count' => 1,
398398
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-ftpext.php',
399399
];
400+
$ignoreErrors[] = [
401+
'message' => '#^Property WP_Filesystem_FTPext\\:\\:\\$link has unknown class FTP\\\\Connection as its type\\.$#',
402+
'identifier' => 'class.notFound',
403+
'count' => 1,
404+
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-ftpext.php',
405+
];
400406
$ignoreErrors[] = [
401407
'message' => '#^Default value of the parameter \\#1 \\$opt \\(string\\) of method WP_Filesystem_ftpsockets\\:\\:__construct\\(\\) is incompatible with type array\\.$#',
402408
'identifier' => 'parameter.defaultValue',
@@ -1171,12 +1177,6 @@
11711177
'count' => 4,
11721178
'path' => __DIR__ . '/../../../src/wp-includes/taxonomy.php',
11731179
];
1174-
$ignoreErrors[] = [
1175-
'message' => '#^Function wp_list_users\\(\\) should return string\\|null but return statement is missing\\.$#',
1176-
'identifier' => 'return.missing',
1177-
'count' => 1,
1178-
'path' => __DIR__ . '/../../../src/wp-includes/user.php',
1179-
];
11801180
$ignoreErrors[] = [
11811181
'message' => '#^PHPDoc tag @var does not specify variable name\\.$#',
11821182
'identifier' => 'varTag.noVariable',

tests/phpstan/baseline/level-3.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -769,18 +769,6 @@
769769
'count' => 1,
770770
'path' => __DIR__ . '/../../../src/wp-includes/theme.php',
771771
];
772-
$ignoreErrors[] = [
773-
'message' => '#^Function _wp_get_current_user\\(\\) should return WP_User but returns array\\|float\\|int\\|string\\|false\\|null\\.$#',
774-
'identifier' => 'return.type',
775-
'count' => 3,
776-
'path' => __DIR__ . '/../../../src/wp-includes/user.php',
777-
];
778-
$ignoreErrors[] = [
779-
'message' => '#^Function _wp_get_current_user\\(\\) should return WP_User but returns null\\.$#',
780-
'identifier' => 'return.type',
781-
'count' => 2,
782-
'path' => __DIR__ . '/../../../src/wp-includes/user.php',
783-
];
784772
$ignoreErrors[] = [
785773
'message' => '#^Static property WP_Widget_Media\\:\\:\\$l10n_defaults \\(array\\<string\\>\\) does not accept array\\<string, array\\|string\\>\\.$#',
786774
'identifier' => 'assign.propertyType',

tests/phpstan/baseline/level-4.php

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -265,12 +265,6 @@
265265
'count' => 1,
266266
'path' => __DIR__ . '/../../../src/wp-includes/block-template-utils.php',
267267
];
268-
$ignoreErrors[] = [
269-
'message' => '#^Strict comparison using \\=\\=\\= between false and mixed will always evaluate to false\\.$#',
270-
'identifier' => 'identical.alwaysFalse',
271-
'count' => 1,
272-
'path' => __DIR__ . '/../../../src/wp-includes/block-template-utils.php',
273-
];
274268
$ignoreErrors[] = [
275269
'message' => '#^While loop condition is always true\\.$#',
276270
'identifier' => 'while.alwaysTrue',
@@ -1081,6 +1075,12 @@
10811075
'count' => 1,
10821076
'path' => __DIR__ . '/../../../src/wp-includes/pluggable.php',
10831077
];
1078+
$ignoreErrors[] = [
1079+
'message' => '#^Call to function is_array\\(\\) with non\\-empty\\-list\\{0\\?\\: string, 1\\?\\: non\\-falsy\\-string&numeric\\-string, 2\\?\\: numeric\\-string, 3\\?\\: numeric\\-string\\} will always evaluate to true\\.$#',
1080+
'identifier' => 'function.alreadyNarrowedType',
1081+
'count' => 1,
1082+
'path' => __DIR__ . '/../../../src/wp-includes/post.php',
1083+
];
10841084
$ignoreErrors[] = [
10851085
'message' => '#^Property WP_Post\\:\\:\\$filter \\(string\\) in isset\\(\\) is not nullable\\.$#',
10861086
'identifier' => 'isset.property',
@@ -1171,24 +1171,6 @@
11711171
'count' => 1,
11721172
'path' => __DIR__ . '/../../../src/wp-includes/theme.php',
11731173
];
1174-
$ignoreErrors[] = [
1175-
'message' => '#^Property WP_Site\\:\\:\\$domain \\(string\\) in isset\\(\\) is not nullable\\.$#',
1176-
'identifier' => 'isset.property',
1177-
'count' => 1,
1178-
'path' => __DIR__ . '/../../../src/wp-includes/user.php',
1179-
];
1180-
$ignoreErrors[] = [
1181-
'message' => '#^Property WP_User\\:\\:\\$ID \\(int\\) in isset\\(\\) is not nullable\\.$#',
1182-
'identifier' => 'isset.property',
1183-
'count' => 1,
1184-
'path' => __DIR__ . '/../../../src/wp-includes/user.php',
1185-
];
1186-
$ignoreErrors[] = [
1187-
'message' => '#^Right side of && is always true\\.$#',
1188-
'identifier' => 'booleanAnd.rightAlwaysTrue',
1189-
'count' => 2,
1190-
'path' => __DIR__ . '/../../../src/wp-includes/user.php',
1191-
];
11921174
$ignoreErrors[] = [
11931175
'message' => '#^If condition is always false\\.$#',
11941176
'identifier' => 'if.alwaysFalse',

tests/phpstan/baseline/level-5.php

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,6 +1381,12 @@
13811381
'count' => 1,
13821382
'path' => __DIR__ . '/../../../src/wp-includes/pluggable.php',
13831383
];
1384+
$ignoreErrors[] = [
1385+
'message' => '#^Parameter \\#1 \\$post of function get_edit_post_link expects int\\|WP_Post, string given\\.$#',
1386+
'identifier' => 'argument.type',
1387+
'count' => 1,
1388+
'path' => __DIR__ . '/../../../src/wp-includes/pluggable.php',
1389+
];
13841390
$ignoreErrors[] = [
13851391
'message' => '#^Parameter \\#1 \\$post of function get_permalink expects int\\|WP_Post, string given\\.$#',
13861392
'identifier' => 'argument.type',
@@ -1429,6 +1435,12 @@
14291435
'count' => 1,
14301436
'path' => __DIR__ . '/../../../src/wp-includes/post.php',
14311437
];
1438+
$ignoreErrors[] = [
1439+
'message' => '#^Parameter \\#1 \\$month of function wp_checkdate expects int, string given\\.$#',
1440+
'identifier' => 'argument.type',
1441+
'count' => 1,
1442+
'path' => __DIR__ . '/../../../src/wp-includes/post.php',
1443+
];
14321444
$ignoreErrors[] = [
14331445
'message' => '#^Parameter \\#1 \\$string of function strlen expects string, int\\<2, max\\> given\\.$#',
14341446
'identifier' => 'argument.type',
@@ -1447,23 +1459,29 @@
14471459
'count' => 1,
14481460
'path' => __DIR__ . '/../../../src/wp-includes/post.php',
14491461
];
1462+
$ignoreErrors[] = [
1463+
'message' => '#^Parameter \\#2 \\$day of function wp_checkdate expects int, string given\\.$#',
1464+
'identifier' => 'argument.type',
1465+
'count' => 1,
1466+
'path' => __DIR__ . '/../../../src/wp-includes/post.php',
1467+
];
14501468
$ignoreErrors[] = [
14511469
'message' => '#^Parameter \\#2 \\$object_id of function delete_metadata expects int, null given\\.$#',
14521470
'identifier' => 'argument.type',
14531471
'count' => 2,
14541472
'path' => __DIR__ . '/../../../src/wp-includes/post.php',
14551473
];
14561474
$ignoreErrors[] = [
1457-
'message' => '#^Parameter \\#1 \\$data_object of method WP_REST_Controller\\:\\:update_additional_fields_for_object\\(\\) expects object, array given\\.$#',
1475+
'message' => '#^Parameter \\#3 \\$year of function wp_checkdate expects int, string given\\.$#',
14581476
'identifier' => 'argument.type',
14591477
'count' => 1,
1460-
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php',
1478+
'path' => __DIR__ . '/../../../src/wp-includes/post.php',
14611479
];
14621480
$ignoreErrors[] = [
1463-
'message' => '#^Parameter \\#1 \\$value of function wp_slash expects array\\|string, stdClass\\|WP_Error given\\.$#',
1481+
'message' => '#^Parameter \\#1 \\$data_object of method WP_REST_Controller\\:\\:update_additional_fields_for_object\\(\\) expects object, array given\\.$#',
14641482
'identifier' => 'argument.type',
14651483
'count' => 1,
1466-
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php',
1484+
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php',
14671485
];
14681486
$ignoreErrors[] = [
14691487
'message' => '#^Parameter \\#1 \\$comment_id of function get_comment_type expects int\\|WP_Comment, string given\\.$#',
@@ -1477,6 +1495,12 @@
14771495
'count' => 1,
14781496
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php',
14791497
];
1498+
$ignoreErrors[] = [
1499+
'message' => '#^Parameter \\#1 \\$comment_id of function wp_new_comment_notify_postauthor expects int, string given\\.$#',
1500+
'identifier' => 'argument.type',
1501+
'count' => 1,
1502+
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php',
1503+
];
14801504
$ignoreErrors[] = [
14811505
'message' => '#^Parameter \\#1 \\$comment_id of function wp_trash_comment expects int\\|WP_Comment, string given\\.$#',
14821506
'identifier' => 'argument.type',
@@ -1651,6 +1675,12 @@
16511675
'count' => 1,
16521676
'path' => __DIR__ . '/../../../src/wp-includes/taxonomy.php',
16531677
];
1678+
$ignoreErrors[] = [
1679+
'message' => '#^Parameter \\#2 \\$newvalue of function ini_set expects string, int given\\.$#',
1680+
'identifier' => 'argument.type',
1681+
'count' => 1,
1682+
'path' => __DIR__ . '/../../../src/wp-includes/template.php',
1683+
];
16541684
$ignoreErrors[] = [
16551685
'message' => '#^Parameter \\#3 \\$replacement of function _deprecated_file expects string, null given\\.$#',
16561686
'identifier' => 'argument.type',
@@ -1681,12 +1711,6 @@
16811711
'count' => 1,
16821712
'path' => __DIR__ . '/../../../src/wp-includes/theme-templates.php',
16831713
];
1684-
$ignoreErrors[] = [
1685-
'message' => '#^Parameter \\#1 \\$string of function mb_strlen expects string, int\\<2, max\\> given\\.$#',
1686-
'identifier' => 'argument.type',
1687-
'count' => 1,
1688-
'path' => __DIR__ . '/../../../src/wp-includes/user.php',
1689-
];
16901714
$ignoreErrors[] = [
16911715
'message' => '#^Parameter \\#3 \\$control_callback of function wp_register_widget_control expects callable\\(\\)\\: mixed, \'\' given\\.$#',
16921716
'identifier' => 'argument.type',

tests/phpstan/baseline/level-6.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -301,30 +301,6 @@
301301
'count' => 1,
302302
'path' => __DIR__ . '/../../../src/wp-admin/includes/file.php',
303303
];
304-
$ignoreErrors[] = [
305-
'message' => '#^Function get_registered_block_templates\\(\\) has parameter \\$query with no type specified\\.$#',
306-
'identifier' => 'missingType.parameter',
307-
'count' => 1,
308-
'path' => __DIR__ . '/../../../src/wp-includes/block-template-utils.php',
309-
];
310-
$ignoreErrors[] = [
311-
'message' => '#^Function wp_assign_new_template_to_theme\\(\\) has parameter \\$changes with no type specified\\.$#',
312-
'identifier' => 'missingType.parameter',
313-
'count' => 1,
314-
'path' => __DIR__ . '/../../../src/wp-includes/block-template-utils.php',
315-
];
316-
$ignoreErrors[] = [
317-
'message' => '#^Function wp_assign_new_template_to_theme\\(\\) has parameter \\$request with no type specified\\.$#',
318-
'identifier' => 'missingType.parameter',
319-
'count' => 1,
320-
'path' => __DIR__ . '/../../../src/wp-includes/block-template-utils.php',
321-
];
322-
$ignoreErrors[] = [
323-
'message' => '#^Function wp_maybe_activate_template\\(\\) has parameter \\$post_id with no type specified\\.$#',
324-
'identifier' => 'missingType.parameter',
325-
'count' => 1,
326-
'path' => __DIR__ . '/../../../src/wp-includes/block-template-utils.php',
327-
];
328304
$ignoreErrors[] = [
329305
'message' => '#^Property WP_Admin_Bar\\:\\:\\$bound has no type specified\\.$#',
330306
'identifier' => 'missingType.property',

0 commit comments

Comments
 (0)