瀏覽代碼

Fix link collection

jsor 13 年之前
父節點
當前提交
28a8b3e4c5
共有 1 個文件被更改,包括 4 次插入7 次删除
  1. 4 7
      src/Composer/Command/InstallCommand.php

+ 4 - 7
src/Composer/Command/InstallCommand.php

@@ -185,17 +185,14 @@ EOT
 
     private function collectLinks(InputInterface $input, PackageInterface $package)
     {
-        $requiredOnly     = (Boolean) $input->getOption('no-install-recommends');
-        $includeSuggested = (Boolean) $input->getOption('install-suggests');
-
         $links = $package->getRequires();
 
-        if (!$requiredOnly) {
+        if (!$input->getOption('no-install-recommends')) {
             $links = array_merge($links, $package->getRecommends());
+        }
 
-            if ($includeSuggested) {
-                $links = array_merge($links, $package->getSuggests());
-            }
+        if ($input->getOption('install-suggests')) {
+            $links = array_merge($links, $package->getSuggests());
         }
 
         return $links;