public static function registerConfig($customConfig)
{
if (!is_object($customConfig)) {
throw new InvalidArgumentException('Custom config must be a object');
}
if (!method_exists($customConfig, 'getConfig')) {
throw new InvalidArgumentException('Custom config object must have getConfig method');
}
$reflection = new ReflectionMethod($customConfig, 'getConfig');
if (!$reflection->isPublic()) {
throw new InvalidArgumentException('Custom config method getConfig must be public');
}
$config = self::getInstanceNoReload();
$config->addCustomConfig($customConfig);
return self::$configInstance;
}