From 6ff7694de1380c3e222b5a9fa63641e8134ed45d Mon Sep 17 00:00:00 2001 From: Justin Rainbow Date: Sun, 8 Jan 2012 13:37:01 -0700 Subject: [PATCH] Fixing error when no requirements are defined --- src/Composer/Command/InitCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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');