diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index 829f5d5d5..0582a6fa8 100644 --- a/src/Composer/Command/InitCommand.php +++ b/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');