Skip to content

Commit e8d563b

Browse files
committed
tests: regenerate PHPStan baselines after rebase
1 parent 1fb721b commit e8d563b

6 files changed

Lines changed: 20 additions & 86 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"squizlabs/php_codesniffer": "3.10.3",
2121
"wp-coding-standards/wpcs": "~3.1.0",
2222
"phpcompatibility/phpcompatibility-wp": "~2.1.3",
23-
"phpstan/phpstan": "2.0.2",
23+
"phpstan/phpstan": "2.0.3",
2424
"yoast/phpunit-polyfills": "^1.1.0"
2525
},
2626
"config": {

tests/phpstan/baseline/level-0.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@
3131
'count' => 1,
3232
'path' => __DIR__ . '/../../../src/wp-admin/press-this.php',
3333
];
34-
$ignoreErrors[] = [
35-
'message' => '#^Function wp_get_duotone_filter_svg not found\\.$#',
36-
'identifier' => 'function.notFound',
37-
'count' => 1,
38-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-theme-json.php',
39-
];
4034
$ignoreErrors[] = [
4135
'message' => '#^Method WP_Customize_Background_Image_Setting\\:\\:update\\(\\) should return bool but return statement is missing\\.$#',
4236
'identifier' => 'return.missing',
@@ -67,12 +61,6 @@
6761
'count' => 1,
6862
'path' => __DIR__ . '/../../../src/wp-includes/plugin.php',
6963
];
70-
$ignoreErrors[] = [
71-
'message' => '#^Cannot unset offset 0 on array\\<string, string\\>\\.$#',
72-
'identifier' => 'unset.offset',
73-
'count' => 1,
74-
'path' => __DIR__ . '/../../../src/wp-includes/rest-api.php',
75-
];
7664
$ignoreErrors[] = [
7765
'message' => '#^Unsafe usage of new static\\(\\)\\.$#',
7866
'identifier' => 'new.static',

tests/phpstan/baseline/level-2.php

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -535,12 +535,6 @@
535535
'count' => 1,
536536
'path' => __DIR__ . '/../../../src/wp-admin/includes/nav-menu.php',
537537
];
538-
$ignoreErrors[] = [
539-
'message' => '#^Binary operation "/" between string\\|WP_Error and 50 results in an error\\.$#',
540-
'identifier' => 'binaryOp.invalid',
541-
'count' => 1,
542-
'path' => __DIR__ . '/../../../src/wp-admin/includes/nav-menu.php',
543-
];
544538
$ignoreErrors[] = [
545539
'message' => '#^Cannot access property \\$front_or_home on array\\|WP_Post\\.$#',
546540
'identifier' => 'property.nonObject',
@@ -733,12 +727,6 @@
733727
'count' => 1,
734728
'path' => __DIR__ . '/../../../src/wp-admin/includes/taxonomy.php',
735729
];
736-
$ignoreErrors[] = [
737-
'message' => '#^Binary operation "\\+" between int\\<1, max\\> and string results in an error\\.$#',
738-
'identifier' => 'binaryOp.invalid',
739-
'count' => 1,
740-
'path' => __DIR__ . '/../../../src/wp-admin/includes/upgrade.php',
741-
];
742730
$ignoreErrors[] = [
743731
'message' => '#^PHPDoc tag @var does not specify variable name\\.$#',
744732
'identifier' => 'varTag.noVariable',
@@ -865,12 +853,6 @@
865853
'count' => 1,
866854
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-customize-manager.php',
867855
];
868-
$ignoreErrors[] = [
869-
'message' => '#^Binary operation "\\+" between string and 1 results in an error\\.$#',
870-
'identifier' => 'binaryOp.invalid',
871-
'count' => 1,
872-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-date-query.php',
873-
];
874856
$ignoreErrors[] = [
875857
'message' => '#^Binary operation "/" between string and 255 results in an error\\.$#',
876858
'identifier' => 'binaryOp.invalid',
@@ -1105,12 +1087,6 @@
11051087
'count' => 1,
11061088
'path' => __DIR__ . '/../../../src/wp-includes/comment.php',
11071089
];
1108-
$ignoreErrors[] = [
1109-
'message' => '#^Function array_key_first\\(\\) should return int\\|string\\|null but return statement is missing\\.$#',
1110-
'identifier' => 'return.missing',
1111-
'count' => 1,
1112-
'path' => __DIR__ . '/../../../src/wp-includes/compat.php',
1113-
];
11141090
$ignoreErrors[] = [
11151091
'message' => '#^Cannot access property \\$term_id on string\\|WP_Customize_Setting\\.$#',
11161092
'identifier' => 'property.nonObject',
@@ -1183,12 +1159,6 @@
11831159
'count' => 1,
11841160
'path' => __DIR__ . '/../../../src/wp-includes/fonts/class-wp-font-face-resolver.php',
11851161
];
1186-
$ignoreErrors[] = [
1187-
'message' => '#^Binary operation "\\+\\=" between string and 7 results in an error\\.$#',
1188-
'identifier' => 'assignOp.invalid',
1189-
'count' => 1,
1190-
'path' => __DIR__ . '/../../../src/wp-includes/functions.php',
1191-
];
11921162
$ignoreErrors[] = [
11931163
'message' => '#^PHPDoc tag @param references unknown parameter\\: \\$key$#',
11941164
'identifier' => 'parameter.notFound',
@@ -1207,18 +1177,6 @@
12071177
'count' => 1,
12081178
'path' => __DIR__ . '/../../../src/wp-includes/functions.php',
12091179
];
1210-
$ignoreErrors[] = [
1211-
'message' => '#^Binary operation "\\-" between string and int results in an error\\.$#',
1212-
'identifier' => 'binaryOp.invalid',
1213-
'count' => 3,
1214-
'path' => __DIR__ . '/../../../src/wp-includes/general-template.php',
1215-
];
1216-
$ignoreErrors[] = [
1217-
'message' => '#^PHPDoc tag @var has invalid value \\(\\[string, array\\]\\|null\\)\\: Unexpected token "\\]", expected \'\\(\' at offset 202 on line 8$#',
1218-
'identifier' => 'phpDoc.parseError',
1219-
'count' => 1,
1220-
'path' => __DIR__ . '/../../../src/wp-includes/html-api/class-wp-html-processor-state.php',
1221-
];
12221180
$ignoreErrors[] = [
12231181
'message' => '#^PHPDoc tag @var does not specify variable name\\.$#',
12241182
'identifier' => 'varTag.noVariable',
@@ -1261,12 +1219,6 @@
12611219
'count' => 1,
12621220
'path' => __DIR__ . '/../../../src/wp-includes/option.php',
12631221
];
1264-
$ignoreErrors[] = [
1265-
'message' => '#^Binary operation "\\+\\=" between string and 3600 results in an error\\.$#',
1266-
'identifier' => 'assignOp.invalid',
1267-
'count' => 1,
1268-
'path' => __DIR__ . '/../../../src/wp-includes/pluggable.php',
1269-
];
12701222
$ignoreErrors[] = [
12711223
'message' => '#^Cannot access property \\$ID on array\\|object\\.$#',
12721224
'identifier' => 'property.nonObject',
@@ -1339,12 +1291,6 @@
13391291
'count' => 1,
13401292
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php',
13411293
];
1342-
$ignoreErrors[] = [
1343-
'message' => '#^Method WP_REST_Posts_Controller\\:\\:handle_terms\\(\\) should return WP_Error\\|null but return statement is missing\\.$#',
1344-
'identifier' => 'return.missing',
1345-
'count' => 1,
1346-
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php',
1347-
];
13481294
$ignoreErrors[] = [
13491295
'message' => '#^Cannot access property \\$post_content on array\\|object\\.$#',
13501296
'identifier' => 'property.nonObject',
@@ -1363,12 +1309,6 @@
13631309
'count' => 1,
13641310
'path' => __DIR__ . '/../../../src/wp-includes/revision.php',
13651311
];
1366-
$ignoreErrors[] = [
1367-
'message' => '#^Binary operation "/" between string\\|WP_Error and int results in an error\\.$#',
1368-
'identifier' => 'binaryOp.invalid',
1369-
'count' => 1,
1370-
'path' => __DIR__ . '/../../../src/wp-includes/sitemaps/providers/class-wp-sitemaps-taxonomies.php',
1371-
];
13721312
$ignoreErrors[] = [
13731313
'message' => '#^Cannot access property \\$object_id on array\\|int\\|string\\|WP_Term\\.$#',
13741314
'identifier' => 'property.nonObject',

tests/phpstan/baseline/level-4.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@
950950
'path' => __DIR__ . '/../../../src/wp-admin/includes/update-core.php',
951951
];
952952
$ignoreErrors[] = [
953-
'message' => '#^Strict comparison using \\!\\=\\= between \'\' and literal\\-string&non\\-falsy\\-string will always evaluate to true\\.$#',
953+
'message' => '#^Strict comparison using \\!\\=\\= between \'\' and literal\\-string&lowercase\\-string&non\\-falsy\\-string will always evaluate to true\\.$#',
954954
'identifier' => 'notIdentical.alwaysTrue',
955955
'count' => 1,
956956
'path' => __DIR__ . '/../../../src/wp-admin/includes/update-core.php',
@@ -3805,6 +3805,12 @@
38053805
'count' => 1,
38063806
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-template-autosaves-controller.php',
38073807
];
3808+
$ignoreErrors[] = [
3809+
'message' => '#^Right side of && is always true\\.$#',
3810+
'identifier' => 'booleanAnd.rightAlwaysTrue',
3811+
'count' => 1,
3812+
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php',
3813+
];
38083814
$ignoreErrors[] = [
38093815
'message' => '#^Call to function is_string\\(\\) with string will always evaluate to true\\.$#',
38103816
'identifier' => 'function.alreadyNarrowedType',

tests/phpstan/baseline/level-5.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -607,12 +607,6 @@
607607
'count' => 1,
608608
'path' => __DIR__ . '/../../../src/wp-admin/includes/plugin-install.php',
609609
];
610-
$ignoreErrors[] = [
611-
'message' => '#^Parameter \\#2 \\$allowed_html of function wp_kses expects array\\<array\\>\\|string, array\\<string, array\\<string, bool\\>\\|true\\> given\\.$#',
612-
'identifier' => 'argument.type',
613-
'count' => 4,
614-
'path' => __DIR__ . '/../../../src/wp-admin/includes/plugin.php',
615-
];
616610
$ignoreErrors[] = [
617611
'message' => '#^Parameter \\#1 \\$text of function esc_attr expects string, int given\\.$#',
618612
'identifier' => 'argument.type',
@@ -1375,6 +1369,12 @@
13751369
'count' => 2,
13761370
'path' => __DIR__ . '/../../../src/wp-includes/functions.php',
13771371
];
1372+
$ignoreErrors[] = [
1373+
'message' => '#^Parameter \\#2 \\$allowed_html of function wp_kses expects array\\<array\\>\\|string, array\\<string, array\\<string, bool\\>\\|true\\> given\\.$#',
1374+
'identifier' => 'argument.type',
1375+
'count' => 4,
1376+
'path' => __DIR__ . '/../../../src/wp-includes/functions.php',
1377+
];
13781378
$ignoreErrors[] = [
13791379
'message' => '#^Parameter \\#2 \\$fallback_url of function wp_validate_redirect expects string, false given\\.$#',
13801380
'identifier' => 'argument.type',

tests/phpstan/baseline/level-6.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9493,12 +9493,6 @@
94939493
'count' => 1,
94949494
'path' => __DIR__ . '/../../../src/wp-includes/html-api/class-wp-html-open-elements.php',
94959495
];
9496-
$ignoreErrors[] = [
9497-
'message' => '#^Property WP_HTML_Processor_State\\:\\:\\$context_node has no type specified\\.$#',
9498-
'identifier' => 'missingType.property',
9499-
'count' => 1,
9500-
'path' => __DIR__ . '/../../../src/wp-includes/html-api/class-wp-html-processor-state.php',
9501-
];
95029496
$ignoreErrors[] = [
95039497
'message' => '#^Method WP_HTML_Tag_Processor\\:\\:class_list\\(\\) has no return type specified\\.$#',
95049498
'identifier' => 'missingType.return',
@@ -10057,6 +10051,12 @@
1005710051
'count' => 1,
1005810052
'path' => __DIR__ . '/../../../src/wp-includes/media.php',
1005910053
];
10054+
$ignoreErrors[] = [
10055+
'message' => '#^Function wp_print_auto_sizes_contain_css_fix\\(\\) has no return type specified\\.$#',
10056+
'identifier' => 'missingType.return',
10057+
'count' => 1,
10058+
'path' => __DIR__ . '/../../../src/wp-includes/media.php',
10059+
];
1006010060
$ignoreErrors[] = [
1006110061
'message' => '#^Function wp_underscore_playlist_templates\\(\\) has no return type specified\\.$#',
1006210062
'identifier' => 'missingType.return',

0 commit comments

Comments
 (0)