protected function getConfig(array $config) : array
{
if (!array_key_exists('profiles', $config)) {
throw new InvalidArgumentException('Missing configuration key [profiles].');
}
foreach (array_get($config, 'profiles') as $profile) {
$keys = ['sources', 'destinations', 'processor', 'namer'];
foreach ($keys as $key) {
if (!array_key_exists($key, $profile)) {
throw new InvalidArgumentException("Missing profile configuration key [{$key}].");
}
}
}
return $config;
}