From cd80f22781777a27ce22f179401ca2b9407634d1 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 21 Sep 2011 23:03:35 +0200 Subject: [PATCH] Type is not mandatory --- src/Composer/Package/Loader/ArrayLoader.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Composer/Package/Loader/ArrayLoader.php b/src/Composer/Package/Loader/ArrayLoader.php index 789db93a2..83a6e2051 100644 --- a/src/Composer/Package/Loader/ArrayLoader.php +++ b/src/Composer/Package/Loader/ArrayLoader.php @@ -36,7 +36,7 @@ class ArrayLoader $version = $versionParser->parse($config['version']); $package = new Package\MemoryPackage($config['name'], $version['version'], $version['type']); - $package->setType($config['type']); + $package->setType(isset($config['type']) ? $config['type'] : 'library'); if (isset($config['extra'])) { $package->setExtra($config['extra']); @@ -107,9 +107,6 @@ class ArrayLoader if (!isset($config['name'])) { throw new \UnexpectedValueException('name is required for package'); } - if (!isset($config['type'])) { - throw new \UnexpectedValueException('type is required for package'); - } if (!isset($config['version'])) { throw new \UnexpectedValueException('version is required for package'); }