Docs: Add missing @return tag to Language_Pack_Upgrader::check_package().

Synchronize documentation of the `::check_package()` method between `Plugin_Upgrader`, `Theme_Upgrader`, and `Language_Pack_Upgrader`.

Props ankitmaru, mukesh27, desrosj.
Fixes #51448.

git-svn-id: https://develop.svn.wordpress.org/trunk@49091 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-10-05 13:42:04 +00:00
parent c8ed3ebb30
commit b31b69ab49
3 changed files with 11 additions and 14 deletions

View File

@ -309,17 +309,18 @@ class Language_Pack_Upgrader extends WP_Upgrader {
}
/**
* Check the package source to make sure there are .mo and .po files.
* Checks that the package source contains .mo and .po files.
*
* Hooked to the {@see 'upgrader_source_selection'} filter by
* Language_Pack_Upgrader::bulk_upgrade().
*
* @since 3.7.0
*
* @global WP_Filesystem_Base $wp_filesystem Subclass
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
*
* @param string|WP_Error $source
* @param string $remote_source
* @param string|WP_Error $source The path to the downloaded package source.
* @param string $remote_source Remote file source location.
* @return string|WP_Error The source as passed, or a WP_Error object on failure.
*/
public function check_package( $source, $remote_source ) {
global $wp_filesystem;

View File

@ -398,10 +398,9 @@ class Plugin_Upgrader extends WP_Upgrader {
}
/**
* Check a source package to be sure it contains a plugin.
* Checks that the source package contains a valid plugin.
*
* This function is added to the {@see 'upgrader_source_selection'} filter by
* Plugin_Upgrader::install().
* Hooked to the {@see 'upgrader_source_selection'} filter by Plugin_Upgrader::install().
*
* @since 3.3.0
*
@ -409,8 +408,7 @@ class Plugin_Upgrader extends WP_Upgrader {
* @global string $wp_version The WordPress version string.
*
* @param string $source The path to the downloaded package source.
* @return string|WP_Error The source as passed, or a WP_Error object
* if no plugins were found.
* @return string|WP_Error The source as passed, or a WP_Error object on failure.
*/
public function check_package( $source ) {
global $wp_filesystem, $wp_version;

View File

@ -510,19 +510,17 @@ class Theme_Upgrader extends WP_Upgrader {
}
/**
* Check that the package source contains a valid theme.
* Checks that the package source contains a valid theme.
*
* Hooked to the {@see 'upgrader_source_selection'} filter by Theme_Upgrader::install().
* It will return an error if the theme doesn't have style.css or index.php
* files.
*
* @since 3.3.0
*
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
* @global string $wp_version The WordPress version string.
*
* @param string $source The full path to the package source.
* @return string|WP_Error The source or a WP_Error.
* @param string $source The path to the downloaded package source.
* @return string|WP_Error The source as passed, or a WP_Error object on failure.
*/
public function check_package( $source ) {
global $wp_filesystem, $wp_version;