Skip to content

Commit 8b1ef9b

Browse files
committed
WP/DeprecatedClasses: update the class list based on WP 6.5-RC3
Based on a scan of WP Core at commit WordPress/wordpress-develop@3595704 using a preliminary sniff created for issue 1803. Includes tests.
1 parent 5e988d8 commit 8b1ef9b

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

WordPress/Sniffs/WP/DeprecatedClassesSniff.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final class DeprecatedClassesSniff extends AbstractClassRestrictionsSniff {
4141
*
4242
* Version numbers should be fully qualified.
4343
*
44-
* Last update: July 2023 for WP 6.3 at https://github.com/WordPress/wordpress-develop/commit/6281ce432c50345a57768bf53854d9b65b6cdd52
44+
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
4545
*
4646
* @var array
4747
*/
@@ -84,6 +84,16 @@ final class DeprecatedClassesSniff extends AbstractClassRestrictionsSniff {
8484
'alt' => 'The PHP native JSON extension',
8585
'version' => '5.3.0',
8686
),
87+
88+
// WP 6.4.0.
89+
'WP_Http_Curl' => array(
90+
'alt' => 'WP_Http',
91+
'version' => '6.4.0',
92+
),
93+
'WP_Http_Streams' => array(
94+
'alt' => 'WP_Http',
95+
'version' => '6.4.0',
96+
),
8797
);
8898

8999
/**

WordPress/Tests/WP/DeprecatedClassesUnitTest.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@ $json = new Services_JSON;
2323
$json = new Services_JSON_Error;
2424
class Prefix_Menu_section extends WP_Privacy_Data_Export_Requests_Table {}
2525
WP_Privacy_Data_Removal_Requests_Table::foo();
26+
27+
/*
28+
* Warning
29+
*/
30+
/* ============ WP 6.4 ============ */
31+
WP_Http_Curl::do_something();
32+
$streams = new WP_Http_Streams();

WordPress/Tests/WP/DeprecatedClassesUnitTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ public function getErrorList() {
4343
* @return array<int, int> Key is the line number, value is the number of expected warnings.
4444
*/
4545
public function getWarningList() {
46-
return array();
46+
return array(
47+
31 => 1,
48+
32 => 1,
49+
);
4750
}
4851
}

0 commit comments

Comments
 (0)