Skip to content

Commit bee227b

Browse files
committed
baselines:
0 -15 1 - 11 2 - 279 3 - 123 4-225 5-446 6-111
1 parent ac35e3a commit bee227b

7 files changed

Lines changed: 1247 additions & 2243 deletions

File tree

tests/phpstan/baseline/level-0.php

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,68 +2,80 @@
22

33
$ignoreErrors = [];
44
$ignoreErrors[] = [
5-
// identifier: return.missing
65
'message' => '#^Method WP_Filesystem_SSH2\\:\\:touch\\(\\) should return bool but return statement is missing\\.$#',
6+
'identifier' => 'return.missing',
77
'count' => 1,
88
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-ssh2.php',
99
];
1010
$ignoreErrors[] = [
11-
// identifier: function.notFound
1211
'message' => '#^Function get_file not found\\.$#',
12+
'identifier' => 'function.notFound',
1313
'count' => 1,
1414
'path' => __DIR__ . '/../../../src/wp-admin/load-scripts.php',
1515
];
1616
$ignoreErrors[] = [
17-
// identifier: function.notFound
1817
'message' => '#^Function get_file not found\\.$#',
18+
'identifier' => 'function.notFound',
1919
'count' => 1,
2020
'path' => __DIR__ . '/../../../src/wp-admin/load-styles.php',
2121
];
2222
$ignoreErrors[] = [
23-
// identifier: class.notFound
2423
'message' => '#^Instantiated class WP_Press_This_Plugin not found\\.$#',
24+
'identifier' => 'class.notFound',
25+
'count' => 1,
26+
'path' => __DIR__ . '/../../../src/wp-admin/press-this.php',
27+
];
28+
$ignoreErrors[] = [
29+
'message' => '#^Path in include\\(\\) "/press\\-this/class\\-wp\\-press\\-this\\-plugin\\.php" is not a file or it does not exist\\.$#',
30+
'identifier' => 'include.fileNotFound',
2531
'count' => 1,
2632
'path' => __DIR__ . '/../../../src/wp-admin/press-this.php',
2733
];
2834
$ignoreErrors[] = [
29-
// identifier: return.missing
3035
'message' => '#^Method WP_Theme_JSON\\:\\:should_override_preset\\(\\) should return bool but return statement is missing\\.$#',
36+
'identifier' => 'return.missing',
3137
'count' => 1,
3238
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-theme-json.php',
3339
];
3440
$ignoreErrors[] = [
35-
// identifier: return.missing
3641
'message' => '#^Method WP_Customize_Background_Image_Setting\\:\\:update\\(\\) should return bool but return statement is missing\\.$#',
42+
'identifier' => 'return.missing',
3743
'count' => 1,
3844
'path' => __DIR__ . '/../../../src/wp-includes/customize/class-wp-customize-background-image-setting.php',
3945
];
4046
$ignoreErrors[] = [
41-
// identifier: return.missing
4247
'message' => '#^Method WP_Customize_Filter_Setting\\:\\:update\\(\\) should return bool but return statement is missing\\.$#',
48+
'identifier' => 'return.missing',
4349
'count' => 1,
4450
'path' => __DIR__ . '/../../../src/wp-includes/customize/class-wp-customize-filter-setting.php',
4551
];
4652
$ignoreErrors[] = [
47-
// identifier: return.missing
4853
'message' => '#^Method WP_Customize_Header_Image_Setting\\:\\:update\\(\\) should return bool but return statement is missing\\.$#',
49-
'count' => 1,
54+
'identifier' => 'return.missing',
55+
'count' => 2,
5056
'path' => __DIR__ . '/../../../src/wp-includes/customize/class-wp-customize-header-image-setting.php',
5157
];
5258
$ignoreErrors[] = [
53-
// identifier: class.notFound
59+
'message' => '#^Unsafe usage of new static\\(\\)\\.$#',
60+
'identifier' => 'new.static',
61+
'count' => 2,
62+
'path' => __DIR__ . '/../../../src/wp-includes/html-api/class-wp-html-processor.php',
63+
];
64+
$ignoreErrors[] = [
5465
'message' => '#^Class GdImage not found\\.$#',
66+
'identifier' => 'class.notFound',
5567
'count' => 1,
5668
'path' => __DIR__ . '/../../../src/wp-includes/media.php',
5769
];
5870
$ignoreErrors[] = [
59-
// identifier: new.static
6071
'message' => '#^Unsafe usage of new static\\(\\)\\.$#',
72+
'identifier' => 'new.static',
6173
'count' => 1,
6274
'path' => __DIR__ . '/../../../src/wp-includes/style-engine/class-wp-style-engine-css-rules-store.php',
6375
];
6476
$ignoreErrors[] = [
65-
// identifier: variable.undefined
6677
'message' => '#^Undefined variable\\: \\$s$#',
78+
'identifier' => 'variable.undefined',
6779
'count' => 1,
6880
'path' => __DIR__ . '/../../../src/wp-includes/template.php',
6981
];

tests/phpstan/baseline/level-1.php

Lines changed: 13 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -2,148 +2,70 @@
22

33
$ignoreErrors = [];
44
$ignoreErrors[] = [
5-
// identifier: variable.undefined
6-
'message' => '#^Call to function compact\\(\\) contains possibly undefined variable \\$comment_author\\.$#',
7-
'count' => 1,
8-
'path' => __DIR__ . '/../../../src/wp-admin/includes/ajax-actions.php',
9-
];
10-
$ignoreErrors[] = [
11-
// identifier: variable.undefined
12-
'message' => '#^Call to function compact\\(\\) contains possibly undefined variable \\$comment_author_email\\.$#',
13-
'count' => 1,
14-
'path' => __DIR__ . '/../../../src/wp-admin/includes/ajax-actions.php',
15-
];
16-
$ignoreErrors[] = [
17-
// identifier: variable.undefined
18-
'message' => '#^Call to function compact\\(\\) contains possibly undefined variable \\$comment_author_url\\.$#',
19-
'count' => 1,
20-
'path' => __DIR__ . '/../../../src/wp-admin/includes/ajax-actions.php',
21-
];
22-
$ignoreErrors[] = [
23-
// identifier: variable.undefined
24-
'message' => '#^Call to function compact\\(\\) contains possibly undefined variable \\$user_id\\.$#',
25-
'count' => 1,
26-
'path' => __DIR__ . '/../../../src/wp-admin/includes/ajax-actions.php',
27-
];
28-
$ignoreErrors[] = [
29-
// identifier: isset.variable
30-
'message' => '#^Variable \\$_POST in isset\\(\\) always exists and is not nullable\\.$#',
31-
'count' => 1,
32-
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-custom-image-header.php',
33-
];
34-
$ignoreErrors[] = [
35-
// identifier: constructor.unusedParameter
365
'message' => '#^Constructor of class WP_Filesystem_Direct has an unused parameter \\$arg\\.$#',
6+
'identifier' => 'constructor.unusedParameter',
377
'count' => 1,
388
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-direct.php',
399
];
4010
$ignoreErrors[] = [
41-
// identifier: empty.variable
4211
'message' => '#^Variable \\$class in empty\\(\\) always exists and is always falsy\\.$#',
12+
'identifier' => 'empty.variable',
4313
'count' => 1,
4414
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-posts-list-table.php',
4515
];
4616
$ignoreErrors[] = [
47-
// identifier: isset.variable
48-
'message' => '#^Variable \\$_POST in isset\\(\\) always exists and is not nullable\\.$#',
49-
'count' => 1,
50-
'path' => __DIR__ . '/../../../src/wp-admin/includes/media.php',
51-
];
52-
$ignoreErrors[] = [
53-
// identifier: empty.variable
5417
'message' => '#^Variable \\$parent_file in empty\\(\\) always exists and is not falsy\\.$#',
18+
'identifier' => 'empty.variable',
5519
'count' => 1,
5620
'path' => __DIR__ . '/../../../src/wp-admin/themes.php',
5721
];
5822
$ignoreErrors[] = [
59-
// identifier: empty.variable
6023
'message' => '#^Variable \\$addl_path in empty\\(\\) always exists and is always falsy\\.$#',
24+
'identifier' => 'empty.variable',
6125
'count' => 1,
6226
'path' => __DIR__ . '/../../../src/wp-includes/canonical.php',
6327
];
6428
$ignoreErrors[] = [
65-
// identifier: isset.variable
66-
'message' => '#^Variable \\$namespace in isset\\(\\) always exists and is not nullable\\.$#',
67-
'count' => 1,
68-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-parser.php',
69-
];
70-
$ignoreErrors[] = [
71-
// identifier: empty.variable
7229
'message' => '#^Variable \\$block_type in empty\\(\\) always exists and is not falsy\\.$#',
30+
'identifier' => 'empty.variable',
7331
'count' => 1,
7432
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-block-supports.php',
7533
];
7634
$ignoreErrors[] = [
77-
// identifier: constructor.unusedParameter
78-
'message' => '#^Constructor of class WP_Feed_Cache_Transient has an unused parameter \\$location\\.$#',
79-
'count' => 1,
80-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-feed-cache-transient.php',
81-
];
82-
$ignoreErrors[] = [
83-
// identifier: constructor.unusedParameter
84-
'message' => '#^Constructor of class WP_Feed_Cache_Transient has an unused parameter \\$type\\.$#',
85-
'count' => 1,
86-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-feed-cache-transient.php',
87-
];
88-
$ignoreErrors[] = [
89-
// identifier: isset.variable
90-
'message' => '#^Variable \\$loader in isset\\(\\) always exists and is not nullable\\.$#',
91-
'count' => 1,
92-
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-oembed.php',
93-
];
94-
$ignoreErrors[] = [
95-
// identifier: isset.variable
9635
'message' => '#^Variable \\$q in isset\\(\\) is never defined\\.$#',
36+
'identifier' => 'isset.variable',
9737
'count' => 1,
9838
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-query.php',
9939
];
10040
$ignoreErrors[] = [
101-
// identifier: empty.variable
10241
'message' => '#^Variable \\$search in empty\\(\\) always exists and is not falsy\\.$#',
42+
'identifier' => 'empty.variable',
10343
'count' => 1,
10444
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-query.php',
10545
];
10646
$ignoreErrors[] = [
107-
// identifier: empty.variable
10847
'message' => '#^Variable \\$status_type_clauses in empty\\(\\) always exists and is not falsy\\.$#',
48+
'identifier' => 'empty.variable',
10949
'count' => 1,
11050
'path' => __DIR__ . '/../../../src/wp-includes/class-wp-query.php',
11151
];
11252
$ignoreErrors[] = [
113-
// identifier: empty.variable
114-
'message' => '#^Variable \\$modes_str in empty\\(\\) always exists and is not falsy\\.$#',
115-
'count' => 1,
116-
'path' => __DIR__ . '/../../../src/wp-includes/class-wpdb.php',
117-
];
118-
$ignoreErrors[] = [
119-
// identifier: isset.variable
120-
'message' => '#^Variable \\$user_already_exists in isset\\(\\) always exists and is not nullable\\.$#',
121-
'count' => 1,
122-
'path' => __DIR__ . '/../../../src/wp-includes/ms-functions.php',
123-
];
124-
$ignoreErrors[] = [
125-
// identifier: empty.variable
12653
'message' => '#^Variable \\$deprecated in empty\\(\\) always exists and is always falsy\\.$#',
54+
'identifier' => 'empty.variable',
12755
'count' => 1,
12856
'path' => __DIR__ . '/../../../src/wp-includes/pluggable.php',
12957
];
13058
$ignoreErrors[] = [
131-
// identifier: empty.variable
132-
'message' => '#^Variable \\$schema in empty\\(\\) is never defined\\.$#',
59+
'message' => '#^Variable \\$the_parent in empty\\(\\) always exists and is not falsy\\.$#',
60+
'identifier' => 'empty.variable',
13361
'count' => 1,
134-
'path' => __DIR__ . '/../../../src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php',
62+
'path' => __DIR__ . '/../../../src/wp-includes/taxonomy.php',
13563
];
13664
$ignoreErrors[] = [
137-
// identifier: isset.variable
13865
'message' => '#^Variable \\$s in isset\\(\\) is never defined\\.$#',
66+
'identifier' => 'isset.variable',
13967
'count' => 1,
14068
'path' => __DIR__ . '/../../../src/wp-includes/template.php',
14169
];
142-
$ignoreErrors[] = [
143-
// identifier: empty.variable
144-
'message' => '#^Variable \\$old_user_data in empty\\(\\) always exists and is not falsy\\.$#',
145-
'count' => 1,
146-
'path' => __DIR__ . '/../../../src/wp-includes/user.php',
147-
];
14870

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

0 commit comments

Comments
 (0)