Pārlūkot izejas kodu

Fix undefined index error, fixes #2224

Jordi Boggiano 11 gadi atpakaļ
vecāks
revīzija
80184b87d1
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      src/Composer/Command/CreateProjectCommand.php

+ 1 - 1
src/Composer/Command/CreateProjectCommand.php

@@ -275,7 +275,7 @@ EOT
         }
 
         // select highest version if we have many
-        $package = $candidates[0];
+        $package = reset($candidates);
         foreach ($candidates as $candidate) {
             if (version_compare($package->getVersion(), $candidate->getVersion(), '<')) {
                 $package = $candidate;