Skip to content

Commit 79fc8a2

Browse files
committed
chore: regenerate PHPStan baselines after rebase
1 parent 2db5b28 commit 79fc8a2

5 files changed

Lines changed: 20 additions & 116 deletions

File tree

tests/phpstan/baseline/level-0.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
<?php declare(strict_types = 1);
22

33
$ignoreErrors = [];
4-
$ignoreErrors[] = [
5-
'message' => '#^Undefined variable\\: \\$transient$#',
6-
'identifier' => 'variable.undefined',
7-
'count' => 2,
8-
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-debug-data.php',
9-
];
104
$ignoreErrors[] = [
115
'message' => '#^Method WP_Filesystem_SSH2\\:\\:touch\\(\\) should return bool but return statement is missing\\.$#',
126
'identifier' => 'return.missing',
137
'count' => 1,
148
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-ssh2.php',
159
];
16-
$ignoreErrors[] = [
17-
'message' => '#^Function wp_get_nav_menu_to_edit\\(\\) should return string\\|WP_Error but return statement is missing\\.$#',
18-
'identifier' => 'return.missing',
19-
'count' => 1,
20-
'path' => __DIR__ . '/../../../src/wp-admin/includes/nav-menu.php',
21-
];
2210
$ignoreErrors[] = [
2311
'message' => '#^Instantiated class WP_Press_This_Plugin not found\\.$#',
2412
'identifier' => 'class.notFound',
@@ -31,12 +19,6 @@
3119
'count' => 1,
3220
'path' => __DIR__ . '/../../../src/wp-admin/press-this.php',
3321
];
34-
$ignoreErrors[] = [
35-
'message' => '#^Array has 2 duplicate keys with value \'Code\' \\(\'Code\', \'Code\'\\)\\.$#',
36-
'identifier' => 'array.duplicateKey',
37-
'count' => 1,
38-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-editor.php',
39-
];
4022
$ignoreErrors[] = [
4123
'message' => '#^Method WP_Customize_Background_Image_Setting\\:\\:update\\(\\) should return bool but return statement is missing\\.$#',
4224
'identifier' => 'return.missing',
@@ -55,12 +37,6 @@
5537
'count' => 2,
5638
'path' => __DIR__ . '/../../../src/wp-includes/customize/class-wp-customize-header-image-setting.php',
5739
];
58-
$ignoreErrors[] = [
59-
'message' => '#^Function _wp_filter_build_unique_id\\(\\) should return string but return statement is missing\\.$#',
60-
'identifier' => 'return.missing',
61-
'count' => 1,
62-
'path' => __DIR__ . '/../../../src/wp-includes/plugin.php',
63-
];
6440
$ignoreErrors[] = [
6541
'message' => '#^Unsafe usage of new static\\(\\)\\.$#',
6642
'identifier' => 'new.static',

tests/phpstan/baseline/level-1.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@
4343
'count' => 1,
4444
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-custom-image-header.php',
4545
];
46-
$ignoreErrors[] = [
47-
'message' => '#^Variable \\$transient in isset\\(\\) is never defined\\.$#',
48-
'identifier' => 'isset.variable',
49-
'count' => 2,
50-
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-debug-data.php',
51-
];
5246
$ignoreErrors[] = [
5347
'message' => '#^Constructor of class WP_Filesystem_Direct has an unused parameter \\$arg\\.$#',
5448
'identifier' => 'constructor.unusedParameter',

tests/phpstan/baseline/level-2.php

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -793,12 +793,6 @@
793793
'count' => 1,
794794
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-image-editor-imagick.php',
795795
];
796-
$ignoreErrors[] = [
797-
'message' => '#^Default value of the parameter \\#1 \\$meta_query \\(false\\) of method WP_Meta_Query\\:\\:__construct\\(\\) is incompatible with type array\\.$#',
798-
'identifier' => 'parameter.defaultValue',
799-
'count' => 1,
800-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-meta-query.php',
801-
];
802796
$ignoreErrors[] = [
803797
'message' => '#^Unsafe call to private method WP_Navigation_Fallback\\:\\:create_classic_menu_fallback\\(\\) through static\\:\\:\\.$#',
804798
'identifier' => 'staticClassAccess.privateMethod',
@@ -943,48 +937,6 @@
943937
'count' => 1,
944938
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-theme-json.php',
945939
];
946-
$ignoreErrors[] = [
947-
'message' => '#^Default value of the parameter \\#1 \\$blog_id \\(string\\) of method WP_User\\:\\:for_blog\\(\\) is incompatible with type int\\.$#',
948-
'identifier' => 'parameter.defaultValue',
949-
'count' => 1,
950-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-user.php',
951-
];
952-
$ignoreErrors[] = [
953-
'message' => '#^Default value of the parameter \\#1 \\$site_id \\(string\\) of method WP_User\\:\\:for_site\\(\\) is incompatible with type int\\.$#',
954-
'identifier' => 'parameter.defaultValue',
955-
'count' => 1,
956-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-user.php',
957-
];
958-
$ignoreErrors[] = [
959-
'message' => '#^Default value of the parameter \\#2 \\$site_id \\(string\\) of method WP_User\\:\\:init\\(\\) is incompatible with type int\\.$#',
960-
'identifier' => 'parameter.defaultValue',
961-
'count' => 1,
962-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-user.php',
963-
];
964-
$ignoreErrors[] = [
965-
'message' => '#^Default value of the parameter \\#3 \\$site_id \\(string\\) of method WP_User\\:\\:__construct\\(\\) is incompatible with type int\\.$#',
966-
'identifier' => 'parameter.defaultValue',
967-
'count' => 1,
968-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-user.php',
969-
];
970-
$ignoreErrors[] = [
971-
'message' => '#^Default value of the parameter \\#1 \\$zero \\(false\\) of function get_comments_number_text\\(\\) is incompatible with type string\\.$#',
972-
'identifier' => 'parameter.defaultValue',
973-
'count' => 1,
974-
'path' => __DIR__ . '/../../../src/wp-includes/comment-template.php',
975-
];
976-
$ignoreErrors[] = [
977-
'message' => '#^Default value of the parameter \\#2 \\$one \\(false\\) of function get_comments_number_text\\(\\) is incompatible with type string\\.$#',
978-
'identifier' => 'parameter.defaultValue',
979-
'count' => 1,
980-
'path' => __DIR__ . '/../../../src/wp-includes/comment-template.php',
981-
];
982-
$ignoreErrors[] = [
983-
'message' => '#^Default value of the parameter \\#3 \\$more \\(false\\) of function get_comments_number_text\\(\\) is incompatible with type string\\.$#',
984-
'identifier' => 'parameter.defaultValue',
985-
'count' => 1,
986-
'path' => __DIR__ . '/../../../src/wp-includes/comment-template.php',
987-
];
988940
$ignoreErrors[] = [
989941
'message' => '#^Binary operation "\\+" between array\\|int\\<min, \\-1\\>\\|int\\<1, max\\> and 1 results in an error\\.$#',
990942
'identifier' => 'binaryOp.invalid',
@@ -1093,24 +1045,6 @@
10931045
'count' => 3,
10941046
'path' => __DIR__ . '/../../../src/wp-includes/link-template.php',
10951047
];
1096-
$ignoreErrors[] = [
1097-
'message' => '#^Default value of the parameter \\#1 \\$post \\(false\\) of function _get_page_link\\(\\) is incompatible with type int\\|WP_Post\\.$#',
1098-
'identifier' => 'parameter.defaultValue',
1099-
'count' => 1,
1100-
'path' => __DIR__ . '/../../../src/wp-includes/link-template.php',
1101-
];
1102-
$ignoreErrors[] = [
1103-
'message' => '#^Default value of the parameter \\#1 \\$post \\(false\\) of function get_page_link\\(\\) is incompatible with type int\\|WP_Post\\.$#',
1104-
'identifier' => 'parameter.defaultValue',
1105-
'count' => 1,
1106-
'path' => __DIR__ . '/../../../src/wp-includes/link-template.php',
1107-
];
1108-
$ignoreErrors[] = [
1109-
'message' => '#^Default value of the parameter \\#2 \\$post_id \\(string\\) of function post_comments_feed_link\\(\\) is incompatible with type int\\.$#',
1110-
'identifier' => 'parameter.defaultValue',
1111-
'count' => 1,
1112-
'path' => __DIR__ . '/../../../src/wp-includes/link-template.php',
1113-
];
11141048
$ignoreErrors[] = [
11151049
'message' => '#^Cannot access property \\$ID on array\\|object\\.$#',
11161050
'identifier' => 'property.nonObject',
@@ -1123,12 +1057,6 @@
11231057
'count' => 2,
11241058
'path' => __DIR__ . '/../../../src/wp-includes/rest-api.php',
11251059
];
1126-
$ignoreErrors[] = [
1127-
'message' => '#^Cannot call method has_param\\(\\) on array\\.$#',
1128-
'identifier' => 'method.nonObject',
1129-
'count' => 1,
1130-
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/class-wp-rest-server.php',
1131-
];
11321060
$ignoreErrors[] = [
11331061
'message' => '#^Cannot access property \\$plugins on array\\|object\\.$#',
11341062
'identifier' => 'property.nonObject',
@@ -1153,12 +1081,6 @@
11531081
'count' => 1,
11541082
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-block-types-controller.php',
11551083
];
1156-
$ignoreErrors[] = [
1157-
'message' => '#^PHPDoc tag @param has invalid value \\(WP_REST_Controller \\$this The current instance of the controller\\.\\)\\: Unexpected token "\\$this", expected variable at offset 401 on line 9$#',
1158-
'identifier' => 'phpDoc.parseError',
1159-
'count' => 1,
1160-
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php',
1161-
];
11621084
$ignoreErrors[] = [
11631085
'message' => '#^Cannot access property \\$auto_add on WP_Term\\|false\\.$#',
11641086
'identifier' => 'property.nonObject',

tests/phpstan/baseline/level-3.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
'path' => __DIR__ . '/../../../src/wp-admin/includes/misc.php',
111111
];
112112
$ignoreErrors[] = [
113-
'message' => '#^Function wp_get_nav_menu_to_edit\\(\\) should return string\\|WP_Error but returns WP_Term\\|false\\.$#',
113+
'message' => '#^Function wp_get_nav_menu_to_edit\\(\\) should return string\\|WP_Error\\|null but returns WP_Term\\|false\\.$#',
114114
'identifier' => 'return.type',
115115
'count' => 1,
116116
'path' => __DIR__ . '/../../../src/wp-admin/includes/nav-menu.php',

tests/phpstan/baseline/level-4.php

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,12 +2509,6 @@
25092509
'count' => 1,
25102510
'path' => __DIR__ . '/../../../src/wp-includes/comment-template.php',
25112511
];
2512-
$ignoreErrors[] = [
2513-
'message' => '#^Strict comparison using \\=\\=\\= between false and string will always evaluate to false\\.$#',
2514-
'identifier' => 'identical.alwaysFalse',
2515-
'count' => 3,
2516-
'path' => __DIR__ . '/../../../src/wp-includes/comment-template.php',
2517-
];
25182512
$ignoreErrors[] = [
25192513
'message' => '#^Call to function is_array\\(\\) with non\\-empty\\-array\\<WP_Comment\\> will always evaluate to true\\.$#',
25202514
'identifier' => 'function.alreadyNarrowedType',
@@ -3361,6 +3355,18 @@
33613355
'count' => 1,
33623356
'path' => __DIR__ . '/../../../src/wp-includes/ms-blogs.php',
33633357
];
3358+
$ignoreErrors[] = [
3359+
'message' => '#^Result of && is always false\\.$#',
3360+
'identifier' => 'booleanAnd.alwaysFalse',
3361+
'count' => 1,
3362+
'path' => __DIR__ . '/../../../src/wp-includes/ms-default-constants.php',
3363+
];
3364+
$ignoreErrors[] = [
3365+
'message' => '#^Strict comparison using \\=\\=\\= between \'wp\\-content/blogs\\.dir\' and \'\' will always evaluate to false\\.$#',
3366+
'identifier' => 'identical.alwaysFalse',
3367+
'count' => 1,
3368+
'path' => __DIR__ . '/../../../src/wp-includes/ms-default-constants.php',
3369+
];
33643370
$ignoreErrors[] = [
33653371
'message' => '#^Elseif condition is always false\\.$#',
33663372
'identifier' => 'elseif.alwaysFalse',
@@ -3919,6 +3925,12 @@
39193925
'count' => 1,
39203926
'path' => __DIR__ . '/../../../src/wp-includes/rewrite.php',
39213927
];
3928+
$ignoreErrors[] = [
3929+
'message' => '#^If condition is always true\\.$#',
3930+
'identifier' => 'if.alwaysTrue',
3931+
'count' => 1,
3932+
'path' => __DIR__ . '/../../../src/wp-includes/script-loader.php',
3933+
];
39223934
$ignoreErrors[] = [
39233935
'message' => '#^Negated boolean expression is always true\\.$#',
39243936
'identifier' => 'booleanNot.alwaysTrue',
@@ -3940,7 +3952,7 @@
39403952
$ignoreErrors[] = [
39413953
'message' => '#^Ternary operator condition is always false\\.$#',
39423954
'identifier' => 'ternary.alwaysFalse',
3943-
'count' => 1,
3955+
'count' => 3,
39443956
'path' => __DIR__ . '/../../../src/wp-includes/script-loader.php',
39453957
];
39463958
$ignoreErrors[] = [

0 commit comments

Comments
 (0)