File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -501,7 +501,7 @@ public function path( $args ) {
501501 }
502502
503503 /**
504- * Updates all installed WP-CLI packages to their latest version.
504+ * Updates installed WP-CLI packages to their latest version.
505505 *
506506 * ## OPTIONS
507507 *
@@ -581,11 +581,12 @@ public function update( $args = [] ) {
581581 // TODO: The --insecure (to be added here) flag should cause another Composer run with verify disabled.
582582
583583 if ( 0 === $ res ) {
584- if ( ! empty ( $ packages_to_update ) ) {
585- if ( 1 === count ( $ packages_to_update ) ) {
584+ $ num_packages = count ( $ packages_to_update );
585+ if ( $ num_packages > 0 ) {
586+ if ( 1 === $ num_packages ) {
586587 WP_CLI ::success ( 'Package updated successfully. ' );
587588 } else {
588- WP_CLI ::success ( sprintf ( '%d packages updated successfully. ' , count ( $ packages_to_update ) ) );
589+ WP_CLI ::success ( sprintf ( '%d packages updated successfully. ' , $ num_packages ) );
589590 }
590591 } else {
591592 WP_CLI ::success ( 'Packages updated. ' );
You can’t perform that action at this time.
0 commit comments