private function parsePackages($config)
{
if (!array_key_exists('packages', $config)) {
throw new ParseException('The configuration should define a "packages" key.');
}
if (!is_array($config['packages'])) {
throw new ParseException('The packages configuration should be an array.');
}
$packages = array();
foreach ($config['packages'] as $i => $package) {
if (!is_string($package)) {
throw new ParseException(sprintf('The package at key "%s" should be a string, "%s" given.', $i, gettype($package)));
}
$packages[] = $this->extractPackage($package);
}
// allow empty list of config packages
if ($packages) {
$packages = call_user_func_array('array_merge', $packages);
}
return $packages;
}