浏览代码

Move $io->write calls together

Alexander Schwenn 8 年之前
父节点
当前提交
308fa88746
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/Composer/Command/ShowCommand.php

+ 4 - 3
src/Composer/Command/ShowCommand.php

@@ -272,9 +272,6 @@ EOT
         $latestPackages = array();
         $latestPackages = array();
         foreach (array('<info>platform</info>:' => true, '<comment>available</comment>:' => false, '<info>installed</info>:' => true) as $type => $showVersion) {
         foreach (array('<info>platform</info>:' => true, '<comment>available</comment>:' => false, '<info>installed</info>:' => true) as $type => $showVersion) {
             if (isset($packages[$type])) {
             if (isset($packages[$type])) {
-                if ($showAllTypes) {
-                    $io->write($type);
-                }
                 ksort($packages[$type]);
                 ksort($packages[$type]);
 
 
                 $nameLength = $versionLength = $latestLength = 0;
                 $nameLength = $versionLength = $latestLength = 0;
@@ -321,6 +318,10 @@ EOT
                     $latestLength += 2;
                     $latestLength += 2;
                 }
                 }
                 $hasOutdatedPackages = false;
                 $hasOutdatedPackages = false;
+
+                if ($showAllTypes) {
+                    $io->write($type);
+                }
                 foreach ($packages[$type] as $package) {
                 foreach ($packages[$type] as $package) {
                     if (is_object($package)) {
                     if (is_object($package)) {
                         $latestPackage = null;
                         $latestPackage = null;