Skip to content

Commit 9680162

Browse files
committed
phpstan: regenerate baselines after rebase
1 parent 760d701 commit 9680162

File tree

6 files changed

+146
-128
lines changed

6 files changed

+146
-128
lines changed

tests/phpstan/baseline/level-1.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@
7979
'count' => 1,
8080
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-oembed.php',
8181
];
82-
$ignoreErrors[] = [
83-
'message' => '#^Variable \\$q in isset\\(\\) is never defined\\.$#',
84-
'identifier' => 'isset.variable',
85-
'count' => 1,
86-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-query.php',
87-
];
8882
$ignoreErrors[] = [
8983
'message' => '#^Variable \\$search in empty\\(\\) always exists and is not falsy\\.$#',
9084
'identifier' => 'empty.variable',
@@ -127,5 +121,11 @@
127121
'count' => 1,
128122
'path' => __DIR__ . '/../../../src/wp-includes/template.php',
129123
];
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+
];
130130

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

tests/phpstan/baseline/level-2.php

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -409,12 +409,6 @@
409409
'count' => 1,
410410
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-ssh2.php',
411411
];
412-
$ignoreErrors[] = [
413-
'message' => '#^Binary operation "\\." between \'http\\://\' and list\\<string\\>\\|null results in an error\\.$#',
414-
'identifier' => 'binaryOp.invalid',
415-
'count' => 1,
416-
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-importer.php',
417-
];
418412
$ignoreErrors[] = [
419413
'message' => '#^Cannot access property \\$info on array\\|object\\.$#',
420414
'identifier' => 'property.nonObject',
@@ -463,18 +457,6 @@
463457
'count' => 1,
464458
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-theme-install-list-table.php',
465459
];
466-
$ignoreErrors[] = [
467-
'message' => '#^Comparison operation "\\<\\=" between \\(array\\|float\\|int\\) and 0 results in an error\\.$#',
468-
'identifier' => 'smallerOrEqual.invalid',
469-
'count' => 1,
470-
'path' => __DIR__ . '/../../../src/wp-admin/includes/dashboard.php',
471-
];
472-
$ignoreErrors[] = [
473-
'message' => '#^Comparison operation "\\>" between array\\|float\\|int and 0 results in an error\\.$#',
474-
'identifier' => 'greater.invalid',
475-
'count' => 1,
476-
'path' => __DIR__ . '/../../../src/wp-admin/includes/dashboard.php',
477-
];
478460
$ignoreErrors[] = [
479461
'message' => '#^Function _crop_image_resource\\(\\) has invalid return type GdImage\\.$#',
480462
'identifier' => 'class.notFound',
@@ -541,12 +523,6 @@
541523
'count' => 1,
542524
'path' => __DIR__ . '/../../../src/wp-admin/includes/media.php',
543525
];
544-
$ignoreErrors[] = [
545-
'message' => '#^Comparison operation "\\>" between 1 and array\\<int\\|WP_Comment\\>\\|int results in an error\\.$#',
546-
'identifier' => 'greater.invalid',
547-
'count' => 1,
548-
'path' => __DIR__ . '/../../../src/wp-admin/includes/meta-boxes.php',
549-
];
550526
$ignoreErrors[] = [
551527
'message' => '#^Method WP_List_Table\\:\\:display\\(\\) invoked with 1 parameter, 0 required\\.$#',
552528
'identifier' => 'arguments.count',
@@ -751,6 +727,12 @@
751727
'count' => 2,
752728
'path' => __DIR__ . '/../../../src/wp-includes/class-walker-nav-menu.php',
753729
];
730+
$ignoreErrors[] = [
731+
'message' => '#^PHPDoc tag @param for parameter \\$block_type with type array\\<string\\> is incompatible with native type string\\.$#',
732+
'identifier' => 'parameter.phpDocType',
733+
'count' => 1,
734+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-processor.php',
735+
];
754736
$ignoreErrors[] = [
755737
'message' => '#^Access to private property WP_Block_Type\\:\\:\\$uses_context\\.$#',
756738
'identifier' => 'property.private',
@@ -1171,12 +1153,6 @@
11711153
'count' => 1,
11721154
'path' => __DIR__ . '/../../../src/wp-includes/revision.php',
11731155
];
1174-
$ignoreErrors[] = [
1175-
'message' => '#^Cannot access property \\$object_id on array\\|int\\|string\\|WP_Term\\.$#',
1176-
'identifier' => 'property.nonObject',
1177-
'count' => 1,
1178-
'path' => __DIR__ . '/../../../src/wp-includes/taxonomy.php',
1179-
];
11801156
$ignoreErrors[] = [
11811157
'message' => '#^Cannot access property \\$parent on array\\|object\\.$#',
11821158
'identifier' => 'property.nonObject',
@@ -1195,12 +1171,6 @@
11951171
'count' => 4,
11961172
'path' => __DIR__ . '/../../../src/wp-includes/taxonomy.php',
11971173
];
1198-
$ignoreErrors[] = [
1199-
'message' => '#^Comparison operation "\\>" between int\\|string\\|WP_Term and 0 results in an error\\.$#',
1200-
'identifier' => 'greater.invalid',
1201-
'count' => 1,
1202-
'path' => __DIR__ . '/../../../src/wp-includes/taxonomy.php',
1203-
];
12041174
$ignoreErrors[] = [
12051175
'message' => '#^Function wp_list_users\\(\\) should return string\\|null but return statement is missing\\.$#',
12061176
'identifier' => 'return.missing',

tests/phpstan/baseline/level-3.php

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@
1414
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-debug-data.php',
1515
];
1616
$ignoreErrors[] = [
17-
'message' => '#^Method WP_Filesystem_Direct\\:\\:group\\(\\) should return string\\|false but returns int\\<min, \\-1\\>\\|int\\<1, max\\>\\.$#',
17+
'message' => '#^Method WP_Filesystem_Direct\\:\\:group\\(\\) should return string\\|false but returns int\\<1, max\\>\\.$#',
1818
'identifier' => 'return.type',
1919
'count' => 1,
2020
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-direct.php',
2121
];
2222
$ignoreErrors[] = [
23-
'message' => '#^Method WP_Filesystem_Direct\\:\\:owner\\(\\) should return string\\|false but returns int\\<min, \\-1\\>\\|int\\<1, max\\>\\.$#',
23+
'message' => '#^Method WP_Filesystem_Direct\\:\\:owner\\(\\) should return string\\|false but returns int\\<1, max\\>\\.$#',
2424
'identifier' => 'return.type',
2525
'count' => 1,
2626
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-direct.php',
2727
];
2828
$ignoreErrors[] = [
29-
'message' => '#^Method WP_Filesystem_SSH2\\:\\:group\\(\\) should return string\\|false but returns int\\<min, \\-1\\>\\|int\\<1, max\\>\\.$#',
29+
'message' => '#^Method WP_Filesystem_SSH2\\:\\:group\\(\\) should return string\\|false but returns int\\<1, max\\>\\.$#',
3030
'identifier' => 'return.type',
3131
'count' => 1,
3232
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-ssh2.php',
3333
];
3434
$ignoreErrors[] = [
35-
'message' => '#^Method WP_Filesystem_SSH2\\:\\:owner\\(\\) should return string\\|false but returns int\\<min, \\-1\\>\\|int\\<1, max\\>\\.$#',
35+
'message' => '#^Method WP_Filesystem_SSH2\\:\\:owner\\(\\) should return string\\|false but returns int\\<1, max\\>\\.$#',
3636
'identifier' => 'return.type',
3737
'count' => 1,
3838
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-ssh2.php',
@@ -133,36 +133,6 @@
133133
'count' => 1,
134134
'path' => __DIR__ . '/../../../src/wp-includes/blocks.php',
135135
];
136-
$ignoreErrors[] = [
137-
'message' => '#^Offset \'host\' does not exist on array\\{path\\: list\\<string\\>\\|string\\|null\\}\\.$#',
138-
'identifier' => 'offsetAccess.notFound',
139-
'count' => 1,
140-
'path' => __DIR__ . '/../../../src/wp-includes/canonical.php',
141-
];
142-
$ignoreErrors[] = [
143-
'message' => '#^Offset \'port\' does not exist on array\\{path\\: list\\<string\\>\\|string\\|null, host\\?\\: string\\}\\.$#',
144-
'identifier' => 'offsetAccess.notFound',
145-
'count' => 2,
146-
'path' => __DIR__ . '/../../../src/wp-includes/canonical.php',
147-
];
148-
$ignoreErrors[] = [
149-
'message' => '#^Offset \'query\' does not exist on array\\{path\\: list\\<string\\>\\|string\\|null, host\\?\\: string\\}\\.$#',
150-
'identifier' => 'offsetAccess.notFound',
151-
'count' => 2,
152-
'path' => __DIR__ . '/../../../src/wp-includes/canonical.php',
153-
];
154-
$ignoreErrors[] = [
155-
'message' => '#^Offset \'query\' does not exist on array\\{path\\: list\\<string\\>\\|string\\|null\\}\\.$#',
156-
'identifier' => 'offsetAccess.notFound',
157-
'count' => 1,
158-
'path' => __DIR__ . '/../../../src/wp-includes/canonical.php',
159-
];
160-
$ignoreErrors[] = [
161-
'message' => '#^Offset \'scheme\' does not exist on array\\{path\\: list\\<string\\>\\|string\\|null, host\\?\\: string\\}\\.$#',
162-
'identifier' => 'offsetAccess.notFound',
163-
'count' => 1,
164-
'path' => __DIR__ . '/../../../src/wp-includes/canonical.php',
165-
];
166136
$ignoreErrors[] = [
167137
'message' => '#^Function get_category_by_path\\(\\) should return array\\|WP_Error\\|WP_Term\\|null but empty return statement found\\.$#',
168138
'identifier' => 'return.empty',
@@ -199,6 +169,18 @@
199169
'count' => 1,
200170
'path' => __DIR__ . '/../../../src/wp-includes/class-walker-nav-menu.php',
201171
];
172+
$ignoreErrors[] = [
173+
'message' => '#^Method WP_Block_Processor\\:\\:extract_block\\(\\) should return array\\<array\\>\\|null but returns array\\<string, array\\|string\\|null\\>\\.$#',
174+
'identifier' => 'return.type',
175+
'count' => 1,
176+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-processor.php',
177+
];
178+
$ignoreErrors[] = [
179+
'message' => '#^Method WP_Block_Processor\\:\\:extract_block\\(\\) should return array\\<array\\>\\|null but returns array\\<string, list\\<string\\|null\\>\\|string\\|null\\>\\.$#',
180+
'identifier' => 'return.type',
181+
'count' => 1,
182+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-processor.php',
183+
];
202184
$ignoreErrors[] = [
203185
'message' => '#^Method WP_Block_Type\\:\\:__get\\(\\) should return array\\<string\\>\\|string\\|void\\|null but returns array\\<array\\>\\.$#',
204186
'identifier' => 'return.type',
@@ -541,6 +523,12 @@
541523
'count' => 1,
542524
'path' => __DIR__ . '/../../../src/wp-includes/class-wpdb.php',
543525
];
526+
$ignoreErrors[] = [
527+
'message' => '#^Parameter &\\$has_noncharacters by\\-ref type of function _wp_scan_utf8\\(\\) expects bool\\|null, int given\\.$#',
528+
'identifier' => 'parameterByRef.type',
529+
'count' => 2,
530+
'path' => __DIR__ . '/../../../src/wp-includes/compat-utf8.php',
531+
];
544532
$ignoreErrors[] = [
545533
'message' => '#^PHPDoc type array of property WP_Customize_Nav_Menu_Item_Setting\\:\\:\\$default is not covariant with PHPDoc type string of overridden property WP_Customize_Setting\\:\\:\\$default\\.$#',
546534
'identifier' => 'property.phpDocType',

tests/phpstan/baseline/level-4.php

Lines changed: 57 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@
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+
];
268274
$ignoreErrors[] = [
269275
'message' => '#^While loop condition is always true\\.$#',
270276
'identifier' => 'while.alwaysTrue',
@@ -277,24 +283,6 @@
277283
'count' => 1,
278284
'path' => __DIR__ . '/../../../src/wp-includes/canonical.php',
279285
];
280-
$ignoreErrors[] = [
281-
'message' => '#^Offset \'port\' on array\\{path\\: mixed, host\\?\\: mixed\\} in empty\\(\\) does not exist\\.$#',
282-
'identifier' => 'empty.offset',
283-
'count' => 2,
284-
'path' => __DIR__ . '/../../../src/wp-includes/canonical.php',
285-
];
286-
$ignoreErrors[] = [
287-
'message' => '#^Offset \'query\' on array\\{path\\: array\\|string\\|null\\} in empty\\(\\) does not exist\\.$#',
288-
'identifier' => 'empty.offset',
289-
'count' => 1,
290-
'path' => __DIR__ . '/../../../src/wp-includes/canonical.php',
291-
];
292-
$ignoreErrors[] = [
293-
'message' => '#^Offset \'query\' on array\\{path\\: mixed, host\\?\\: mixed\\} in empty\\(\\) does not exist\\.$#',
294-
'identifier' => 'empty.offset',
295-
'count' => 2,
296-
'path' => __DIR__ . '/../../../src/wp-includes/canonical.php',
297-
];
298286
$ignoreErrors[] = [
299287
'message' => '#^Unreachable statement \\- code above always terminates\\.$#',
300288
'identifier' => 'deadCode.unreachable',
@@ -313,12 +301,48 @@
313301
'count' => 1,
314302
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-bindings-registry.php',
315303
];
304+
$ignoreErrors[] = [
305+
'message' => '#^If condition is always false\\.$#',
306+
'identifier' => 'if.alwaysFalse',
307+
'count' => 1,
308+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-processor.php',
309+
];
310+
$ignoreErrors[] = [
311+
'message' => '#^Property WP_Block_Processor\\:\\:\\$last_error \\(string\\|null\\) is never assigned string so it can be removed from the property type\\.$#',
312+
'identifier' => 'property.unusedType',
313+
'count' => 1,
314+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-processor.php',
315+
];
316+
$ignoreErrors[] = [
317+
'message' => '#^Unreachable statement \\- code above always terminates\\.$#',
318+
'identifier' => 'deadCode.unreachable',
319+
'count' => 1,
320+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-processor.php',
321+
];
316322
$ignoreErrors[] = [
317323
'message' => '#^Negated boolean expression is always true\\.$#',
318324
'identifier' => 'booleanNot.alwaysTrue',
319325
'count' => 1,
320326
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-templates-registry.php',
321327
];
328+
$ignoreErrors[] = [
329+
'message' => '#^Negated boolean expression is always true\\.$#',
330+
'identifier' => 'booleanNot.alwaysTrue',
331+
'count' => 1,
332+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block.php',
333+
];
334+
$ignoreErrors[] = [
335+
'message' => '#^Result of \\|\\| is always true\\.$#',
336+
'identifier' => 'booleanOr.alwaysTrue',
337+
'count' => 1,
338+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block.php',
339+
];
340+
$ignoreErrors[] = [
341+
'message' => '#^Unreachable statement \\- code above always terminates\\.$#',
342+
'identifier' => 'deadCode.unreachable',
343+
'count' => 1,
344+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block.php',
345+
];
322346
$ignoreErrors[] = [
323347
'message' => '#^Negated boolean expression is always false\\.$#',
324348
'identifier' => 'booleanNot.alwaysFalse',
@@ -397,24 +421,12 @@
397421
'count' => 1,
398422
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-customize-widgets.php',
399423
];
400-
$ignoreErrors[] = [
401-
'message' => '#^Call to function is_array\\(\\) with mixed will always evaluate to false\\.$#',
402-
'identifier' => 'function.impossibleType',
403-
'count' => 1,
404-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-date-query.php',
405-
];
406424
$ignoreErrors[] = [
407425
'message' => '#^Property WP_Dependencies\\:\\:\\$all_queued_deps \\(array\\) in isset\\(\\) is not nullable\\.$#',
408426
'identifier' => 'isset.property',
409427
'count' => 1,
410428
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-dependencies.php',
411429
];
412-
$ignoreErrors[] = [
413-
'message' => '#^Property _WP_Dependency\\:\\:\\$ver \\(bool\\|string\\) on left side of \\?\\? is not nullable\\.$#',
414-
'identifier' => 'nullCoalesce.property',
415-
'count' => 1,
416-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-dependencies.php',
417-
];
418430
$ignoreErrors[] = [
419431
'message' => '#^Unreachable statement \\- code above always terminates\\.$#',
420432
'identifier' => 'deadCode.unreachable',
@@ -590,23 +602,17 @@
590602
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-rewrite.php',
591603
];
592604
$ignoreErrors[] = [
593-
'message' => '#^Property _WP_Dependency\\:\\:\\$args \\(array\\) in isset\\(\\) is not nullable\\.$#',
594-
'identifier' => 'isset.property',
605+
'message' => '#^Method WP_Script_Modules\\:\\:get_marked_for_enqueue\\(\\) is unused\\.$#',
606+
'identifier' => 'method.unused',
595607
'count' => 1,
596-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-scripts.php',
608+
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-script-modules.php',
597609
];
598610
$ignoreErrors[] = [
599611
'message' => '#^Property _WP_Dependency\\:\\:\\$translations_path \\(string\\) in isset\\(\\) is not nullable\\.$#',
600612
'identifier' => 'isset.property',
601613
'count' => 1,
602614
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-scripts.php',
603615
];
604-
$ignoreErrors[] = [
605-
'message' => '#^Property _WP_Dependency\\:\\:\\$args \\(array\\) in isset\\(\\) is not nullable\\.$#',
606-
'identifier' => 'isset.property',
607-
'count' => 1,
608-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-styles.php',
609-
];
610616
$ignoreErrors[] = [
611617
'message' => '#^Comparison operation "\\<\\=" between 0 and int\\<0, max\\>\\|false is always true\\.$#',
612618
'identifier' => 'smallerOrEqual.alwaysTrue',
@@ -715,6 +721,18 @@
715721
'count' => 1,
716722
'path' => __DIR__ . '/../../../src/wp-includes/class-wpdb.php',
717723
];
724+
$ignoreErrors[] = [
725+
'message' => '#^Function _wp_scan_utf8\\(\\) never assigns null to &\\$has_noncharacters so it can be removed from the by\\-ref type\\.$#',
726+
'identifier' => 'parameterByRef.unusedType',
727+
'count' => 1,
728+
'path' => __DIR__ . '/../../../src/wp-includes/compat-utf8.php',
729+
];
730+
$ignoreErrors[] = [
731+
'message' => '#^Function _wp_utf8_codepoint_span\\(\\) never assigns null to &\\$found_code_points so it can be removed from the by\\-ref type\\.$#',
732+
'identifier' => 'parameterByRef.unusedType',
733+
'count' => 1,
734+
'path' => __DIR__ . '/../../../src/wp-includes/compat-utf8.php',
735+
];
718736
$ignoreErrors[] = [
719737
'message' => '#^Instanceof between mixed and ResourceBundle will always evaluate to false\\.$#',
720738
'identifier' => 'instanceof.alwaysFalse',

0 commit comments

Comments
 (0)