Skip to content

Commit c65d63b

Browse files
committed
Update default minimum supported WP version
What with the target release date for WPCS 2.2.0 being November 11 and the target release date of WP 5.3 being November 12, updating this property before the release is probably a good idea.
1 parent 981b7d4 commit c65d63b

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

WordPress/Sniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ abstract class Sniff implements PHPCS_Sniff {
8282
*
8383
* @var string WordPress version.
8484
*/
85-
public $minimum_supported_version = '4.9';
85+
public $minimum_supported_version = '5.0';
8686

8787
/**
8888
* Custom list of classes which test classes can extend.

WordPress/Tests/WP/DeprecatedClassesUnitTest.inc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ echo \WP_User_Search::prepare_query();
1313
class My_User_Search extends WP_User_Search {}
1414
class Our_User_Search implements WP_User_Search {}
1515
$a = (new WP_User_Search())->query();
16+
/* ============ WP 4.9 ============ */
17+
class Prefix_Menu_section extends Customize_New_Menu_Section {}
18+
WP_Customize_New_Menu_Control::foo();
1619

1720
/*
1821
* Warning.
1922
*/
20-
class Prefix_Menu_section extends Customize_New_Menu_Section {}
21-
WP_Customize_New_Menu_Control::foo();
23+
/* ============ WP 5.3 ============ */
2224
$json = new Services_JSON;

WordPress/Tests/WP/DeprecatedClassesUnitTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ class DeprecatedClassesUnitTest extends AbstractSniffUnitTest {
2727
* @return array <int line number> => <int number of errors>
2828
*/
2929
public function getErrorList() {
30-
return array_fill( 9, 7, 1 );
30+
$errors = array_fill( 9, 10, 1 );
31+
32+
// Unset the lines related to version comments.
33+
unset( $errors[16] );
34+
35+
return $errors;
3136
}
3237

3338
/**
@@ -36,7 +41,7 @@ public function getErrorList() {
3641
* @return array <int line number> => <int number of warnings>
3742
*/
3843
public function getWarningList() {
39-
return array_fill( 20, 3, 1 );
44+
return array_fill( 24, 1, 1 );
4045
}
4146

4247
}

WordPress/Tests/WP/DeprecatedFunctionsUnitTest.inc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,15 +329,15 @@ wp_get_network();
329329
wp_kses_js_entities();
330330
/* ============ WP 4.8 ============ */
331331
wp_dashboard_plugins_output();
332-
333-
/*
334-
* Warning.
335-
*/
336332
/* ============ WP 4.9 ============ */
337333
get_shortcut_link();
338334
is_user_option_local();
339335
wp_ajax_press_this_add_category();
340336
wp_ajax_press_this_save_post();
337+
338+
/*
339+
* Warning.
340+
*/
341341
/* ============ WP 5.1 ============ */
342342
insert_blog();
343343
install_blog();

WordPress/Tests/WP/DeprecatedFunctionsUnitTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class DeprecatedFunctionsUnitTest extends AbstractSniffUnitTest {
2828
*/
2929
public function getErrorList() {
3030

31-
$errors = array_fill( 8, 324, 1 );
31+
$errors = array_fill( 8, 329, 1 );
3232

3333
// Unset the lines related to version comments.
3434
unset(
@@ -62,7 +62,8 @@ public function getErrorList() {
6262
$errors[311],
6363
$errors[319],
6464
$errors[323],
65-
$errors[330]
65+
$errors[330],
66+
$errors[332]
6667
);
6768

6869
return $errors;
@@ -75,10 +76,10 @@ public function getErrorList() {
7576
*/
7677
public function getWarningList() {
7778

78-
$warnings = array_fill( 337, 11, 1 );
79+
$warnings = array_fill( 342, 6, 1 );
7980

8081
// Unset the lines related to version comments.
81-
unset( $warnings[341], $warnings[344] );
82+
unset( $warnings[344] );
8283

8384
return $warnings;
8485
}

0 commit comments

Comments
 (0)