public function loadModule(array $module)
{
foreach ($module as $key => $value) {
if (is_array($value)) {
$this->modules[$key] = new Config($value);
} else {
if ($value instanceof Config) {
$this->modules[$key] = $value;
} else {
throw new Exception('The module config must be either an array or an instance of Pop\\Config.');
}
}
}
return $this;
}