Skip to content

Commit df6b36e

Browse files
committed
tests: exclude additional external libraries to match phpcs.xml.dist
1 parent f5832a0 commit df6b36e

8 files changed

Lines changed: 187 additions & 1691 deletions

File tree

tests/phpstan/base.neon

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,12 @@ parameters:
4242
- ../../src/wp-admin/includes/class-pclzip.php
4343
- ../../src/wp-includes/atomlib.php
4444
- ../../src/wp-includes/class-avif-info.php
45+
- ../../src/wp-includes/class-IXR.php
4546
- ../../src/wp-includes/class-json.php
46-
- ../../src/wp-includes/class-phpmailer.php
47+
- ../../src/wp-includes/class-phpass.php
48+
- ../../src/wp-includes/class-pop3.php
4749
- ../../src/wp-includes/class-requests.php
4850
- ../../src/wp-includes/class-simplepie.php
49-
- ../../src/wp-includes/class-smtp.php
5051
- ../../src/wp-includes/class-snoopy.php
5152
- ../../src/wp-includes/class-wp-feed-cache.php
5253
- ../../src/wp-includes/class-wp-http-ixr-client.php
@@ -56,12 +57,13 @@ parameters:
5657
- ../../src/wp-includes/class-wp-simplepie-sanitize-kses.php
5758
- ../../src/wp-includes/class-wp-text-diff-renderer-inline.php
5859
- ../../src/wp-includes/class-wp-text-diff-renderer-table.php
60+
- ../../src/wp-includes/rss.php
5961
- ../../src/wp-includes/ID3
62+
- ../../src/wp-includes/IXR
6063
- ../../src/wp-includes/PHPMailer
6164
- ../../src/wp-includes/pomo
6265
- ../../src/wp-includes/random_compat
6366
- ../../src/wp-includes/Requests
64-
- ../../src/wp-includes/rss.php
6567
- ../../src/wp-includes/SimplePie
6668
- ../../src/wp-includes/sodium_compat
6769
- ../../src/wp-includes/Text

tests/phpstan/baseline/level-0.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,6 @@
1313
'count' => 1,
1414
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-filesystem-ssh2.php',
1515
];
16-
$ignoreErrors[] = [
17-
// identifier: return.missing
18-
'message' => '#^Method WP_Site_Health_Auto_Updates\\:\\:test_accepts_dev_updates\\(\\) should return array\\|false but return statement is missing\\.$#',
19-
'count' => 1,
20-
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-site-health-auto-updates.php',
21-
];
22-
$ignoreErrors[] = [
23-
// identifier: return.missing
24-
'message' => '#^Method WP_Site_Health_Auto_Updates\\:\\:test_accepts_minor_updates\\(\\) should return array but return statement is missing\\.$#',
25-
'count' => 1,
26-
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-site-health-auto-updates.php',
27-
];
28-
$ignoreErrors[] = [
29-
// identifier: return.missing
30-
'message' => '#^Method WP_Site_Health_Auto_Updates\\:\\:test_constants\\(\\) should return array but return statement is missing\\.$#',
31-
'count' => 1,
32-
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-site-health-auto-updates.php',
33-
];
34-
$ignoreErrors[] = [
35-
// identifier: return.missing
36-
'message' => '#^Method WP_Site_Health_Auto_Updates\\:\\:test_filters_automatic_updater_disabled\\(\\) should return array but return statement is missing\\.$#',
37-
'count' => 1,
38-
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-site-health-auto-updates.php',
39-
];
40-
$ignoreErrors[] = [
41-
// identifier: return.missing
42-
'message' => '#^Method WP_Site_Health_Auto_Updates\\:\\:test_wp_version_check_attached\\(\\) should return array but return statement is missing\\.$#',
43-
'count' => 1,
44-
'path' => __DIR__ . '/../../../src/wp-admin/includes/class-wp-site-health-auto-updates.php',
45-
];
4616
$ignoreErrors[] = [
4717
// identifier: return.missing
4818
'message' => '#^Function wp_get_nav_menu_to_edit\\(\\) should return string\\|WP_Error but return statement is missing\\.$#',

tests/phpstan/baseline/level-1.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,6 @@
133133
'count' => 2,
134134
'path' => __DIR__ . '/../../../src/wp-includes/capabilities.php',
135135
];
136-
$ignoreErrors[] = [
137-
// identifier: empty.variable
138-
'message' => '#^Variable \\$PopArray in empty\\(\\) always exists and is not falsy\\.$#',
139-
'count' => 1,
140-
'path' => __DIR__ . '/../../../src/wp-includes/class-pop3.php',
141-
];
142-
$ignoreErrors[] = [
143-
// identifier: empty.variable
144-
'message' => '#^Variable \\$banner in empty\\(\\) always exists and is not falsy\\.$#',
145-
'count' => 1,
146-
'path' => __DIR__ . '/../../../src/wp-includes/class-pop3.php',
147-
];
148136
$ignoreErrors[] = [
149137
// identifier: isset.variable
150138
'message' => '#^Variable \\$block in isset\\(\\) always exists and is not nullable\\.$#',

tests/phpstan/baseline/level-2.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -883,12 +883,6 @@
883883
'count' => 1,
884884
'path' => __DIR__ . '/../../../src/wp-admin/install.php',
885885
];
886-
$ignoreErrors[] = [
887-
// identifier: arguments.count
888-
'message' => '#^Method WP_Dependencies\\:\\:get_etag\\(\\) invoked with 2 parameters, 1 required\\.$#',
889-
'count' => 1,
890-
'path' => __DIR__ . '/../../../src/wp-admin/load-styles.php',
891-
];
892886
$ignoreErrors[] = [
893887
// identifier: property.notFound
894888
'message' => '#^Access to an undefined property WP_Term\\:\\:\\$truncated_name\\.$#',

tests/phpstan/baseline/level-3.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,6 @@
193193
'count' => 1,
194194
'path' => __DIR__ . '/../../../src/wp-includes/category.php',
195195
];
196-
$ignoreErrors[] = [
197-
// identifier: return.void
198-
'message' => '#^Method POP3\\:\\:__construct\\(\\) with return type void returns true but should not return anything\\.$#',
199-
'count' => 1,
200-
'path' => __DIR__ . '/../../../src/wp-includes/class-pop3.php',
201-
];
202196
$ignoreErrors[] = [
203197
// identifier: method.childParameterType
204198
'message' => '#^Parameter \\#3 \\$args \\(stdClass\\) of method Walker_Nav_Menu\\:\\:end_lvl\\(\\) should be compatible with parameter \\$args \\(array\\) of method Walker\\:\\:end_lvl\\(\\)$#',

tests/phpstan/baseline/level-4.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -949,12 +949,6 @@
949949
'count' => 1,
950950
'path' => __DIR__ . '/../../../src/wp-admin/themes.php',
951951
];
952-
$ignoreErrors[] = [
953-
// identifier: deadCode.unreachable
954-
'message' => '#^Unreachable statement \\- code above always terminates\\.$#',
955-
'count' => 7,
956-
'path' => __DIR__ . '/../../../src/wp-includes/IXR/class-IXR-value.php',
957-
];
958952
$ignoreErrors[] = [
959953
// identifier: return.unusedType
960954
'message' => '#^Function wp_list_authors\\(\\) never returns void so it can be removed from the return type\\.$#',

tests/phpstan/baseline/level-5.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -757,12 +757,6 @@
757757
'count' => 2,
758758
'path' => __DIR__ . '/../../../src/wp-admin/users.php',
759759
];
760-
$ignoreErrors[] = [
761-
// identifier: argument.type
762-
'message' => '#^Parameter \\#3 \\$value of function xml_parser_set_option expects int\\|string, false given\\.$#',
763-
'count' => 1,
764-
'path' => __DIR__ . '/../../../src/wp-includes/IXR/class-IXR-message.php',
765-
];
766760
$ignoreErrors[] = [
767761
// identifier: argument.type
768762
'message' => '#^Parameter \\#1 \\$userid of function count_user_posts expects int, string given\\.$#',
@@ -829,12 +823,6 @@
829823
'count' => 1,
830824
'path' => __DIR__ . '/../../../src/wp-includes/capabilities.php',
831825
];
832-
$ignoreErrors[] = [
833-
// identifier: argument.type
834-
'message' => '#^Parameter \\#2 \\$enable of function socket_set_blocking expects bool, int given\\.$#',
835-
'count' => 1,
836-
'path' => __DIR__ . '/../../../src/wp-includes/class-pop3.php',
837-
];
838826
$ignoreErrors[] = [
839827
// identifier: argument.type
840828
'message' => '#^Parameter \\#1 \\$blog_id of function get_home_url expects int\\|null, string given\\.$#',

0 commit comments

Comments
 (0)