Skip to content

Commit 313ddea

Browse files
authored
Merge pull request #1809 from WordPress/feature/deprecatedclasses-update-list
DeprecatedClasses: update the sniff
2 parents e7bfc16 + b5f989d commit 313ddea

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

WordPress/Sniffs/WP/DeprecatedClassesSniff.php

+14
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

+3
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

+1-1
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)