Skip to content

Commit 3a7f4d4

Browse files
committed
chore: regenerate PHPStan baselines
1 parent d6d59a0 commit 3a7f4d4

File tree

7 files changed

+14
-112
lines changed

7 files changed

+14
-112
lines changed

phpstan.neon.dist

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ parameters:
3737
- '#Default value of the parameter .* is incompatible with type callable.*#'
3838

3939
# Level 6:
40-
# WPCS syntax for iterable types is not supported:
41-
-
40+
- # WPCS syntax for iterable types is not supported:
4241
identifier: missingType.iterableValue
43-
# Too noisy until we allow `void` return types:
44-
-
42+
- # Too noisy until we allow `void` return types:
4543
identifier: missingType.return

tests/phpstan/baseline/level-0.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@
77
'count' => 1,
88
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-ssh2.php',
99
];
10+
$ignoreErrors[] = [
11+
// identifier: function.notFound
12+
'message' => '#^Function get_file not found\\.$#',
13+
'count' => 1,
14+
'path' => __DIR__ . '/../../../src/wp-admin/load-scripts.php',
15+
];
16+
$ignoreErrors[] = [
17+
// identifier: function.notFound
18+
'message' => '#^Function get_file not found\\.$#',
19+
'count' => 1,
20+
'path' => __DIR__ . '/../../../src/wp-admin/load-styles.php',
21+
];
1022
$ignoreErrors[] = [
1123
// identifier: class.notFound
1224
'message' => '#^Instantiated class WP_Press_This_Plugin not found\\.$#',
@@ -43,12 +55,6 @@
4355
'count' => 1,
4456
'path' => __DIR__ . '/../../../src/wp-includes/media.php',
4557
];
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-
];
5258
$ignoreErrors[] = [
5359
// identifier: new.static
5460
'message' => '#^Unsafe usage of new static\\(\\)\\.$#',

tests/phpstan/baseline/level-1.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@
7979
'count' => 1,
8080
'path' => __DIR__ . '/../../../src/wp-includes/canonical.php',
8181
];
82-
$ignoreErrors[] = [
83-
// identifier: empty.variable
84-
'message' => '#^Variable \\$object_subtype in empty\\(\\) always exists and is not falsy\\.$#',
85-
'count' => 2,
86-
'path' => __DIR__ . '/../../../src/wp-includes/capabilities.php',
87-
];
8882
$ignoreErrors[] = [
8983
// identifier: isset.variable
9084
'message' => '#^Variable \\$namespace in isset\\(\\) always exists and is not nullable\\.$#',
@@ -97,12 +91,6 @@
9791
'count' => 1,
9892
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-supports.php',
9993
];
100-
$ignoreErrors[] = [
101-
// identifier: empty.variable
102-
'message' => '#^Variable \\$status_clauses in empty\\(\\) always exists and is not falsy\\.$#',
103-
'count' => 1,
104-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-comment-query.php',
105-
];
10694
$ignoreErrors[] = [
10795
// identifier: constructor.unusedParameter
10896
'message' => '#^Constructor of class WP_Feed_Cache_Transient has an unused parameter \\$location\\.$#',
@@ -175,12 +163,6 @@
175163
'count' => 2,
176164
'path' => __DIR__ . '/../../../src/wp-includes/taxonomy.php',
177165
];
178-
$ignoreErrors[] = [
179-
// identifier: empty.variable
180-
'message' => '#^Variable \\$object_terms in empty\\(\\) always exists and is not falsy\\.$#',
181-
'count' => 1,
182-
'path' => __DIR__ . '/../../../src/wp-includes/taxonomy.php',
183-
];
184166
$ignoreErrors[] = [
185167
// identifier: isset.variable
186168
'message' => '#^Variable \\$s in isset\\(\\) is never defined\\.$#',

tests/phpstan/baseline/level-2.php

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,6 @@
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-
];
148142
$ignoreErrors[] = [
149143
// identifier: property.notFound
150144
'message' => '#^Access to an undefined property WP_Upgrader\\:\\:\\$new_plugin_data\\.$#',
@@ -361,12 +355,6 @@
361355
'count' => 1,
362356
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-walker-nav-menu-edit.php',
363357
];
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-
];
370358
$ignoreErrors[] = [
371359
// identifier: property.nonObject
372360
'message' => '#^Cannot access property \\$current on array\\|object\\.$#',
@@ -433,12 +421,6 @@
433421
'count' => 1,
434422
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-ftpext.php',
435423
];
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-
];
442424
$ignoreErrors[] = [
443425
// identifier: parameter.defaultValue
444426
'message' => '#^Default value of the parameter \\#1 \\$opt \\(string\\) of method WP_Filesystem_ftpsockets\\:\\:__construct\\(\\) is incompatible with type array\\.$#',
@@ -769,18 +751,6 @@
769751
'count' => 1,
770752
'path' => __DIR__ . '/../../../src/wp-admin/includes/post.php',
771753
];
772-
$ignoreErrors[] = [
773-
// identifier: parameter.defaultValue
774-
'message' => '#^Default value of the parameter \\#1 \\$post_id \\(string\\) of function redirect_post\\(\\) is incompatible with type int\\.$#',
775-
'count' => 1,
776-
'path' => __DIR__ . '/../../../src/wp-admin/includes/post.php',
777-
];
778-
$ignoreErrors[] = [
779-
// identifier: parameter.defaultValue
780-
'message' => '#^Default value of the parameter \\#2 \\$post_id \\(string\\) of function wp_create_categories\\(\\) is incompatible with type int\\.$#',
781-
'count' => 1,
782-
'path' => __DIR__ . '/../../../src/wp-admin/includes/taxonomy.php',
783-
];
784754
$ignoreErrors[] = [
785755
// identifier: property.notFound
786756
'message' => '#^Access to an undefined property object\\:\\:\\$current\\.$#',
@@ -1513,18 +1483,6 @@
15131483
'count' => 3,
15141484
'path' => __DIR__ . '/../../../src/wp-includes/nav-menu.php',
15151485
];
1516-
$ignoreErrors[] = [
1517-
// identifier: method.nameCase
1518-
'message' => '#^Call to method PHPMailer\\\\PHPMailer\\\\PHPMailer\\:\\:addBCC\\(\\) with incorrect case\\: addBcc$#',
1519-
'count' => 1,
1520-
'path' => __DIR__ . '/../../../src/wp-includes/pluggable.php',
1521-
];
1522-
$ignoreErrors[] = [
1523-
// identifier: method.nameCase
1524-
'message' => '#^Call to method PHPMailer\\\\PHPMailer\\\\PHPMailer\\:\\:addCC\\(\\) with incorrect case\\: addCc$#',
1525-
'count' => 1,
1526-
'path' => __DIR__ . '/../../../src/wp-includes/pluggable.php',
1527-
];
15281486
$ignoreErrors[] = [
15291487
// identifier: property.notFound
15301488
'message' => '#^Access to an undefined property object\\:\\:\\$name\\.$#',

tests/phpstan/baseline/level-3.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,6 @@
145145
'count' => 1,
146146
'path' => __DIR__ . '/../../../src/wp-includes/block-template-utils.php',
147147
];
148-
$ignoreErrors[] = [
149-
// identifier: return.empty
150-
'message' => '#^Function get_the_block_template_html\\(\\) should return string but empty return statement found\\.$#',
151-
'count' => 1,
152-
'path' => __DIR__ . '/../../../src/wp-includes/block-template.php',
153-
];
154148
$ignoreErrors[] = [
155149
// identifier: offsetAccess.notFound
156150
'message' => '#^Offset \'host\' does not exist on array\\{path\\: array\\<int, string\\>\\|string\\|null\\}\\.$#',
@@ -181,12 +175,6 @@
181175
'count' => 1,
182176
'path' => __DIR__ . '/../../../src/wp-includes/canonical.php',
183177
];
184-
$ignoreErrors[] = [
185-
// identifier: return.type
186-
'message' => '#^Function default_topic_count_scale\\(\\) should return int but returns float\\.$#',
187-
'count' => 1,
188-
'path' => __DIR__ . '/../../../src/wp-includes/category-template.php',
189-
];
190178
$ignoreErrors[] = [
191179
// identifier: return.empty
192180
'message' => '#^Function get_category_by_path\\(\\) should return array\\|WP_Error\\|WP_Term\\|null but empty return statement found\\.$#',
@@ -223,24 +211,6 @@
223211
'count' => 1,
224212
'path' => __DIR__ . '/../../../src/wp-includes/class-walker-nav-menu.php',
225213
];
226-
$ignoreErrors[] = [
227-
// identifier: return.type
228-
'message' => '#^Method WP_Block_Pattern_Categories_Registry\\:\\:get_registered\\(\\) should return array but returns null\\.$#',
229-
'count' => 1,
230-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-pattern-categories-registry.php',
231-
];
232-
$ignoreErrors[] = [
233-
// identifier: return.type
234-
'message' => '#^Method WP_Block_Patterns_Registry\\:\\:get_registered\\(\\) should return array but returns null\\.$#',
235-
'count' => 1,
236-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-patterns-registry.php',
237-
];
238-
$ignoreErrors[] = [
239-
// identifier: return.type
240-
'message' => '#^Method WP_Block_Styles_Registry\\:\\:get_registered\\(\\) should return array but returns null\\.$#',
241-
'count' => 1,
242-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-styles-registry.php',
243-
];
244214
$ignoreErrors[] = [
245215
// identifier: return.type
246216
'message' => '#^Method WP_Block_Type\\:\\:__get\\(\\) should return array\\<string\\>\\|string\\|void\\|null but returns array\\<array\\>\\.$#',

tests/phpstan/baseline/level-4.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,6 @@
103103
'count' => 1,
104104
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-internal-pointers.php',
105105
];
106-
$ignoreErrors[] = [
107-
// identifier: isset.property
108-
'message' => '#^Property WP_List_Table\\:\\:\\$_column_headers \\(array\\) in isset\\(\\) is not nullable\\.$#',
109-
'count' => 1,
110-
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-list-table.php',
111-
];
112106
$ignoreErrors[] = [
113107
// identifier: booleanNot.alwaysFalse
114108
'message' => '#^Negated boolean expression is always false\\.$#',

tests/phpstan/baseline/level-6.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -637,12 +637,6 @@
637637
'count' => 1,
638638
'path' => __DIR__ . '/../../../src/wp-includes/functions.php',
639639
];
640-
$ignoreErrors[] = [
641-
// identifier: missingType.parameter
642-
'message' => '#^Function get_file\\(\\) has parameter \\$path with no type specified\\.$#',
643-
'count' => 1,
644-
'path' => __DIR__ . '/../../../src/wp-includes/js/tinymce/wp-tinymce.php',
645-
];
646640
$ignoreErrors[] = [
647641
// identifier: missingType.generics
648642
'message' => '#^Class WP_REST_Request implements generic interface ArrayAccess but does not specify its types\\: TKey, TValue$#',

0 commit comments

Comments
 (0)