Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/Core_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public function download( $args, $assoc_args ) {
WP_CLI::error( 'Cannot use both --skip-content and --no-extract at the same time.' );
}

$download_url = array_shift( $args );
$download_url = (string) array_shift( $args );
$from_url = ! empty( $download_url );

if ( $from_url ) {
Expand All @@ -225,7 +225,7 @@ public function download( $args, $assoc_args ) {
WP_CLI::error( 'Skip content and locale options are not available for URL downloads.' );
}
} elseif ( isset( $assoc_args['version'] ) && 'latest' !== $assoc_args['version'] ) {
$version = $assoc_args['version'];
$version = (string) $assoc_args['version'];
if ( in_array( strtolower( $version ), [ 'trunk', 'nightly' ], true ) ) {
$version = 'nightly';
}
Expand All @@ -249,6 +249,7 @@ public function download( $args, $assoc_args ) {
WP_CLI::error( "The requested locale ({$locale}) was not found." );
}
}
/** @var array{current: string, download: string} $offer */
$version = $offer['current'];
$download_url = $offer['download'];
}
Expand Down Expand Up @@ -1946,10 +1947,10 @@ private function capture_version_check_error_from_response( $response, $context,
/**
* Clean up extra files.
*
* @param string $version_from Starting version that the installation was updated from.
* @param string $version_to Target version that the installation is updated to.
* @param string $locale Locale of the installation.
* @param bool $insecure Whether to retry without certificate validation on TLS handshake failure.
* @param string|null $version_from Starting version that the installation was updated from.
* @param string|null $version_to Target version that the installation is updated to.
* @param string $locale Locale of the installation.
* @param bool $insecure Whether to retry without certificate validation on TLS handshake failure.
*/
private function cleanup_extra_files( $version_from, $version_to, $locale, $insecure ) {
if ( ! $version_from || ! $version_to ) {
Expand Down
Loading