Type is not mandatory
parent
c67d8ee2a3
commit
cd80f22781
|
@ -36,7 +36,7 @@ class ArrayLoader
|
||||||
$version = $versionParser->parse($config['version']);
|
$version = $versionParser->parse($config['version']);
|
||||||
$package = new Package\MemoryPackage($config['name'], $version['version'], $version['type']);
|
$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'])) {
|
if (isset($config['extra'])) {
|
||||||
$package->setExtra($config['extra']);
|
$package->setExtra($config['extra']);
|
||||||
|
@ -107,9 +107,6 @@ class ArrayLoader
|
||||||
if (!isset($config['name'])) {
|
if (!isset($config['name'])) {
|
||||||
throw new \UnexpectedValueException('name is required for package');
|
throw new \UnexpectedValueException('name is required for package');
|
||||||
}
|
}
|
||||||
if (!isset($config['type'])) {
|
|
||||||
throw new \UnexpectedValueException('type is required for package');
|
|
||||||
}
|
|
||||||
if (!isset($config['version'])) {
|
if (!isset($config['version'])) {
|
||||||
throw new \UnexpectedValueException('version is required for package');
|
throw new \UnexpectedValueException('version is required for package');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue