The `$config['media_class']` key should always be set I think, its defined in the `Configuration`. Better to check that it is not null.

You could also perhaps do something like this:

````php
$keys = array('media_class, 'file_class', 'directory_class', 'image_class');
foreach ($keys as $key) {
if (null !== $config[$key]) {
$container->SetParameter($this->getAlias() . '.' . $key, $config[$key];
}
}
````