Skip to content

Commit

Permalink
don't use array dereferencing
Browse files Browse the repository at this point in the history
- requires PHP >= 5.4
  • Loading branch information
Phil Banks committed Apr 13, 2018
1 parent 3964422 commit a0fe807
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Package_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,8 @@ private function check_git_package_name( $package_name, $version = '' ) {
$response = WP_CLI\Utils\http_request( 'GET', $raw_content_url, null /*data*/, $headers );
if ( 20 != substr( $response->status_code, 0, 2 ) ) {
// Could not get composer.json. Possibly private so warn and return best guess from input (always xxx/xxx).
$package_name = explode( '/', $package_name )[1];
$package_name = explode( '/', $package_name );
$package_name = $package_name[1];
WP_CLI::warning( sprintf( "Couldn't download composer.json file from '%s' (HTTP code %d). Presuming package name is '%s'.", $raw_content_url, $response->status_code, $package_name ) );
return $package_name;
}
Expand Down

0 comments on commit a0fe807

Please sign in to comment.