mirror of
https://ghproxy.net/https://github.com/wp-cli/extension-command.git
synced 2025-10-04 06:06:59 +08:00
Apply suggestions from code review
Co-authored-by: Alain Schlesser <alain.schlesser@gmail.com>
This commit is contained in:
parent
1975695dd1
commit
f7d3b4c190
2 changed files with 3 additions and 3 deletions
|
@ -1276,7 +1276,7 @@ class Plugin_Command extends \WP_CLI\CommandWithUpgrade {
|
|||
/**
|
||||
* @var callable $callback
|
||||
*/
|
||||
$callback = array( $wp_filesystem, 'delete' );
|
||||
$callback = [ $wp_filesystem, 'delete' ];
|
||||
array_map( $callback, $json_translation_files );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ abstract class CommandWithUpgrade extends \WP_CLI_Command {
|
|||
|
||||
$filter = false;
|
||||
// If a GitHub URL, do some guessing as to the correct plugin/theme directory.
|
||||
if ( $is_remote && 'github.com' === \WP_CLI\Utils\parse_url( $slug, PHP_URL_HOST )
|
||||
if ( $is_remote && 'github.com' === Utils\parse_url( $slug, PHP_URL_HOST )
|
||||
// Don't attempt to rename ZIPs uploaded to the releases page or coming from a raw source.
|
||||
&& ! preg_match( '#github\.com/[^/]+/[^/]+/(?:releases/download|raw)/#', $slug ) ) {
|
||||
|
||||
|
@ -211,7 +211,7 @@ abstract class CommandWithUpgrade extends \WP_CLI_Command {
|
|||
/**
|
||||
* @var string $path
|
||||
*/
|
||||
$path = \WP_CLI\Utils\parse_url( $slug, PHP_URL_PATH );
|
||||
$path = Utils\parse_url( $slug, PHP_URL_PATH );
|
||||
$slug_dir = Utils\basename( $path, '.zip' );
|
||||
|
||||
// Don't use the zip name if archive attached to release, as name likely to contain version tag/branch.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue