Browse Source

Fixing error when no requirements are defined

Justin Rainbow 13 năm trước cách đây
mục cha
commit
6ff7694de1
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/Composer/Command/InitCommand.php

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

@@ -52,7 +52,7 @@ EOT
 
         $options = array_filter(array_intersect_key($input->getOptions(), array_flip(array('name','description','require'))));
 
-        $options['require'] = $this->formatRequirements($options['require']);
+        $options['require'] = $this->formatRequirements(isset($options['require']) ? $options['require'] : array());
 
         $file = new JsonFile('composer.json');