OSDN Git Service

Check empty version for mu-plugins, remove unnecessary formatting
authortolgap <tolga@hoppinger.com>
Tue, 30 Apr 2013 09:39:58 +0000 (11:39 +0200)
committertolgap <tolga@hoppinger.com>
Tue, 30 Apr 2013 09:39:58 +0000 (11:39 +0200)
php/WP_CLI/CommandWithUpgrade.php

index a994eb2..01d1c06 100644 (file)
@@ -48,8 +48,10 @@ abstract class CommandWithUpgrade extends \WP_CLI_Command {
                                $line = '  ';
                        }
                        $line .= $this->format_status( $details['status'], 'short' );
-                       $line .= " " . str_pad( $details['name'], $padding );
-                       $line .= "%n " . $this->format_version( $details['version'] ) . "%n";
+                       $line .= " " . str_pad( $details['name'], $padding ). "%n";
+                       if ( !empty( $details['version'] ) ) {
+                               $line .= " " . $details['version'];
+                       }
 
                        \WP_CLI::line( $line );
                }
@@ -199,10 +201,6 @@ abstract class CommandWithUpgrade extends \WP_CLI_Command {
                return $this->get_color( $status ) . $this->map[ $format ][ $status ];
        }
 
-       protected function format_version( $version ) {
-               return '' . $version;
-       }
-
        private function get_color( $status ) {
                static $colors = array(
                        'inactive' => '',