Code Quality: Explicitly return null when documented instead of void.
This fixes a PHPStan rule level 3 error: `return.empty`. Developed in https://github.com/WordPress/wordpress-develop/pull/10995 Props huzaifaalmesbah, westonruter, shailu25, mukesh27, noruzzaman. See #64238. Built from https://develop.svn.wordpress.org/trunk@61716 git-svn-id: http://core.svn.wordpress.org/trunk@61024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -2187,7 +2187,7 @@ function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_own
|
||||
$abstraction_file = apply_filters( 'filesystem_method_file', ABSPATH . 'wp-admin/includes/class-wp-filesystem-' . $method . '.php', $method );
|
||||
|
||||
if ( ! file_exists( $abstraction_file ) ) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
require_once $abstraction_file;
|
||||
|
||||
@@ -926,7 +926,7 @@ function delete_plugins( $plugins, $deprecated = '' ) {
|
||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||
exit;
|
||||
}
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
if ( ! WP_Filesystem( $credentials ) ) {
|
||||
@@ -941,7 +941,7 @@ function delete_plugins( $plugins, $deprecated = '' ) {
|
||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||
exit;
|
||||
}
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
if ( ! is_object( $wp_filesystem ) ) {
|
||||
|
||||
@@ -40,7 +40,7 @@ function delete_theme( $stylesheet, $redirect = '' ) {
|
||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||
exit;
|
||||
}
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
if ( ! WP_Filesystem( $credentials ) ) {
|
||||
@@ -55,7 +55,7 @@ function delete_theme( $stylesheet, $redirect = '' ) {
|
||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||
exit;
|
||||
}
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
if ( ! is_object( $wp_filesystem ) ) {
|
||||
|
||||
@@ -144,7 +144,7 @@ function get_category_by_path( $category_path, $full_match = true, $output = OBJ
|
||||
);
|
||||
|
||||
if ( empty( $categories ) ) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach ( $categories as $category ) {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '7.0-beta1-61715';
|
||||
$wp_version = '7.0-beta1-61716';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
||||
Reference in New Issue
Block a user