Skip to content

Commit b5f989d

Browse files
committed
DeprecatedClasses: update the sniff
Add some more deprecated classes to the list. Refs: * https://core.trac.wordpress.org/ticket/42364 * https://core.trac.wordpress.org/ticket/47699
1 parent e7bfc16 commit b5f989d

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

WordPress/Sniffs/WP/DeprecatedClassesSniff.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ class DeprecatedClassesSniff extends AbstractClassRestrictionsSniff {
4848
'alt' => 'WP_User_Query',
4949
'version' => '3.1.0',
5050
),
51+
52+
// WP 4.9.0.
53+
'Customize_New_Menu_Section' => array(
54+
'version' => '4.9.0',
55+
),
56+
'WP_Customize_New_Menu_Control' => array(
57+
'version' => '4.9.0',
58+
),
59+
60+
// WP 5.3.0.
61+
'Services_JSON' => array(
62+
'alt' => 'The PHP native JSON extension',
63+
'version' => '5.3.0',
64+
),
5165
);
5266

5367

WordPress/Tests/WP/DeprecatedClassesUnitTest.inc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ $a = (new WP_User_Search())->query();
1717
/*
1818
* Warning.
1919
*/
20+
class Prefix_Menu_section extends Customize_New_Menu_Section {}
21+
WP_Customize_New_Menu_Control::foo();
22+
$json = new Services_JSON;

WordPress/Tests/WP/DeprecatedClassesUnitTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function getErrorList() {
3636
* @return array <int line number> => <int number of warnings>
3737
*/
3838
public function getWarningList() {
39-
return array();
39+
return array_fill( 20, 3, 1 );
4040
}
4141

4242
}

0 commit comments

Comments
 (0)