public static function formatConfig($config)
    {
        if (\is_string($config)) {
            $config = ['file' => $config];
        }

        if (!\is_array($config)) {
            throw new UnexpectedTypeException($config, 'array');
        }

        if (!isset($config['file'])) {
            $msg = 'The "file" attribute must be defined in config of layout template';

            throw new InvalidConfigurationException($msg);
        }

        return $config;
    }