public function transformMagicals(array $config)
    {
        if (isset($config['magicals'])) {
            foreach ($config['magicals'] as $magical) {
                if (isset($config['services'][$magical])) {
                    continue;
                }
                if (! isset($config['factories'][$magical])) {
                    $factory = $magical . 'Factory';
                    if (class_exists($factory)) {
                        $config['factories'][$magical] = $factory;
                        continue;
                    }
                    if (! isset($config['invokables'][$magical]) && class_exists($magical)) {
                        $config['invokables'][$magical] = $magical;
                    }
                }
            }
        }
        return $config;
    }