Skip to content

Commit

Permalink
WP/DeprecatedClasses: update the class list based on WP 6.5-RC3
Browse files Browse the repository at this point in the history
Based on a scan of WP Core at commit WordPress/wordpress-develop@3595704 using a preliminary sniff created for issue 1803.

Includes tests.
  • Loading branch information
jrfnl committed Mar 21, 2024
1 parent 5e988d8 commit 8b1ef9b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion WordPress/Sniffs/WP/DeprecatedClassesSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ final class DeprecatedClassesSniff extends AbstractClassRestrictionsSniff {
*
* Version numbers should be fully qualified.
*
* Last update: July 2023 for WP 6.3 at https://github.com/WordPress/wordpress-develop/commit/6281ce432c50345a57768bf53854d9b65b6cdd52
* {@internal To be updated after every major release. Last updated for WordPress 6.5-RC3.}
*
* @var array
*/
Expand Down Expand Up @@ -84,6 +84,16 @@ final class DeprecatedClassesSniff extends AbstractClassRestrictionsSniff {
'alt' => 'The PHP native JSON extension',
'version' => '5.3.0',
),

// WP 6.4.0.
'WP_Http_Curl' => array(
'alt' => 'WP_Http',
'version' => '6.4.0',
),
'WP_Http_Streams' => array(
'alt' => 'WP_Http',
'version' => '6.4.0',
),
);

/**
Expand Down
7 changes: 7 additions & 0 deletions WordPress/Tests/WP/DeprecatedClassesUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ $json = new Services_JSON;
$json = new Services_JSON_Error;
class Prefix_Menu_section extends WP_Privacy_Data_Export_Requests_Table {}
WP_Privacy_Data_Removal_Requests_Table::foo();

/*
* Warning
*/
/* ============ WP 6.4 ============ */
WP_Http_Curl::do_something();
$streams = new WP_Http_Streams();
5 changes: 4 additions & 1 deletion WordPress/Tests/WP/DeprecatedClassesUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ public function getErrorList() {
* @return array<int, int> Key is the line number, value is the number of expected warnings.
*/
public function getWarningList() {
return array();
return array(
31 => 1,
32 => 1,
);
}
}

0 comments on commit 8b1ef9b

Please sign in to comment.