protected function normalizeTemplateDuringRegistration($template)
    {
        if (empty($template['name'])) {
            throw new InvalidArgumentException('Impossible to register a template without "name"');
        }

        if (empty($template['path'])) {
            throw new InvalidArgumentException('Impossible to register a template without "path"');
        }

        $template['description'] = isset($template['description']) ? $template['description'] : '';
        $template['aliases'] = isset($template['aliases']) ? $template['aliases'] : [];
        $template['is_alias'] = false;

        return $template;
    }