@@ -30,7 +30,7 @@ public function __construct() {
3030 // Do not automatically check translations updates after updating plugins/themes.
3131 add_action (
3232 'upgrader_process_complete ' ,
33- function () {
33+ function () {
3434 remove_action ( 'upgrader_process_complete ' , [ 'Language_Pack_Upgrader ' , 'async_upgrade ' ], 20 );
3535 },
3636 1
@@ -170,7 +170,7 @@ public function install( $args, $assoc_args ) {
170170 // Don't attempt to rename ZIPs uploaded to the releases page or coming from a raw source.
171171 && ! preg_match ( '#github\.com/[^/]+/[^/]+/(?:releases/download|raw)/# ' , $ slug ) ) {
172172
173- $ filter = function ( $ source , $ remote_source , $ upgrader ) use ( $ slug ) {
173+ $ filter = function ( $ source , $ remote_source , $ upgrader ) use ( $ slug ) {
174174
175175 $ slug_dir = Utils \basename ( $ this ->parse_url_host_component ( $ slug , PHP_URL_PATH ), '.zip ' );
176176
@@ -202,30 +202,30 @@ public function install( $args, $assoc_args ) {
202202 if ( $ filter ) {
203203 remove_filter ( 'upgrader_source_selection ' , $ filter , 10 );
204204 }
205- $ successes ++ ;
205+ ++ $ successes ;
206206 } else {
207- $ errors ++ ;
207+ ++ $ errors ;
208208 }
209209 } else {
210210 // Assume a plugin/theme slug from the WordPress.org repository has been specified.
211211 $ result = $ this ->install_from_repo ( $ slug , $ assoc_args );
212212
213213 if ( is_null ( $ result ) ) {
214- $ errors ++ ;
214+ ++ $ errors ;
215215 } elseif ( is_wp_error ( $ result ) ) {
216216 $ key = $ result ->get_error_code ();
217217 if ( in_array ( $ key , [ 'plugins_api_failed ' , 'themes_api_failed ' ], true )
218218 && ! empty ( $ result ->error_data [ $ key ] ) && in_array ( $ result ->error_data [ $ key ], [ 'N; ' , 'b:0; ' ], true ) ) {
219219 WP_CLI ::warning ( "Couldn't find ' $ slug' in the WordPress.org {$ this ->item_type } directory. " );
220- $ errors ++ ;
220+ ++ $ errors ;
221221 } else {
222222 WP_CLI ::warning ( "$ slug: " . $ result ->get_error_message () );
223223 if ( 'already_installed ' !== $ key ) {
224- $ errors ++ ;
224+ ++ $ errors ;
225225 }
226226 }
227227 } else {
228- $ successes ++ ;
228+ ++ $ successes ;
229229 }
230230 }
231231
@@ -381,7 +381,7 @@ protected function update_many( $args, $assoc_args ) {
381381 foreach ( $ items_to_update as $ item_key => $ item_info ) {
382382 if ( static ::INVALID_VERSION_MESSAGE === $ item_info ['update ' ] ) {
383383 WP_CLI ::warning ( "{$ item_info ['name ' ]}: " . static ::INVALID_VERSION_MESSAGE . '. ' );
384- $ skipped ++ ;
384+ ++ $ skipped ;
385385 unset( $ items_to_update [ $ item_key ] );
386386 }
387387 }
@@ -426,7 +426,7 @@ protected function update_many( $args, $assoc_args ) {
426426 }
427427 $ upgrader = $ this ->get_upgrader ( $ assoc_args );
428428 // Ensure the upgrader uses the download offer present in each item.
429- $ transient_filter = function ( $ transient ) use ( $ items_to_update ) {
429+ $ transient_filter = function ( $ transient ) use ( $ items_to_update ) {
430430 foreach ( $ items_to_update as $ name => $ item_data ) {
431431 if ( isset ( $ transient ->response [ $ name ] ) ) {
432432 $ transient ->response [ $ name ]->new_version = $ item_data ['update_version ' ];
@@ -467,7 +467,7 @@ static function ( $result ) {
467467 'status ' => ( null !== $ result [ $ info ['update_id ' ] ] && ! is_wp_error ( $ result [ $ info ['update_id ' ] ] ) ) ? 'Updated ' : 'Error ' ,
468468 ];
469469 if ( null === $ result [ $ info ['update_id ' ] ] || is_wp_error ( $ result [ $ info ['update_id ' ] ] ) ) {
470- $ errors ++ ;
470+ ++ $ errors ;
471471 }
472472 }
473473
@@ -767,5 +767,4 @@ private function parse_url_host_component( $url, $component ) {
767767 // phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url -- parse_url will only be used in absence of wp_parse_url.
768768 return function_exists ( 'wp_parse_url ' ) ? wp_parse_url ( $ url , $ component ) : parse_url ( $ url , $ component );
769769 }
770-
771770}
0 commit comments