<commit_before><?php

/*
 * This file is part of Twig.
 *
 * (c) <NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Twig\Extra\TwigExtraBundle;

use Twig\Extra\CssInliner\CssInlinerExtension;
use Twig\Extra\Html\HtmlExtension;
use Twig\Extra\Inky\InkyExtension;
use Twig\Extra\Intl\IntlExtension;
use Twig\Extra\Markdown\MarkdownExtension;
use Twig\Extra\String\StringExtension;

final class Extensions
{
    private const EXTENSIONS = [
        'html' => [
            'name' => 'html',
            'class' => HtmlExtension::class,
            'class_name' => 'HtmlExtension',
            'package' => 'twig/html-extra',
            'filters' => ['data_uri'],
            'functions' => ['html_classes'],
        ],
        'markdown' => [
            'name' => 'markdown',
            'class' => MarkdownExtension::class,
            'class_name' => 'MarkdownExtension',
            'package' => 'twig/markdown-extra',
            'filters' => ['html_to_markdown', 'markdown_to_html'],
            'functions' => [],
        ],
        'intl' => [
            'name' => 'intl',
            'class' => IntlExtension::class,
            'class_name' => 'IntlExtension',
            'package' => 'twig/intl-extra',
            'filters' => ['country_name', 'currency_name', 'currency_symbol', 'language_name',
                'format_currency', 'format_number', 'format_decimal_number', 'format_currency_number',
                'format_percent_number', 'format_scientific_number', 'format_spellout_number', 'format_ordinal_number',
                'format_duration_number', 'format_date', 'format_datetime', 'format_time',
            ],
            'functions' => ['country_timezones'],
        ],
        'cssinliner' => [
            'name' => 'cssinliner',
            'class' => CssInlinerExtension::class,
            'class_name' => 'CssInlinerExtension',
            'package' => 'twig/cssinliner-extra',
            'filters' => ['inline_css'],
            'functions' => [],
        ],
        'inky' => [
            'name' => 'inky',
            'class' => InkyExtension::class,
            'class_name' => 'InkyExtension',
            'package' => 'twig/inky-extra',
            'filters' => ['inky_to_html'],
            'functions' => [],
        ],
        'string' => [
            'name' => 'string',
            'class' => StringExtension::class,
            'class_name' => 'StringExtension',
            'package' => 'twig/string-extra',
            'filters' => ['u'],
            'functions' => [],
        ],
    ];

    public static function getClasses(): array
    {
        return array_column(self::EXTENSIONS, 'class', 'name');
    }

    public static function getFilter(string $name): array
    {
        foreach (self::EXTENSIONS as $extension) {
            if (\in_array($name, $extension['filters'])) {
                return [$extension['class_name'], $extension['package']];
            }
        }

        return [];
    }

    public static function getFunction(string $name): array
    {
        foreach (self::EXTENSIONS as $extension) {
            if (\in_array($name, $extension['functions'])) {
                return [$extension['class_name'], $extension['package']];
            }
        }

        return [];
    }
}
<commit_msg>Add missing suggestions in Twig Extra Bundle<commit_after><?php

/*
 * This file is part of Twig.
 *
 * (c) <NAME>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Twig\Extra\TwigExtraBundle;

use Twig\Extra\CssInliner\CssInlinerExtension;
use Twig\Extra\Html\HtmlExtension;
use Twig\Extra\Inky\InkyExtension;
use Twig\Extra\Intl\IntlExtension;
use Twig\Extra\Markdown\MarkdownExtension;
use Twig\Extra\String\StringExtension;

final class Extensions
{
    private const EXTENSIONS = [
        'html' => [
            'name' => 'html',
            'class' => HtmlExtension::class,
            'class_name' => 'HtmlExtension',
            'package' => 'twig/html-extra',
            'filters' => ['data_uri'],
            'functions' => ['html_classes'],
        ],
        'markdown' => [
            'name' => 'markdown',
            'class' => MarkdownExtension::class,
            'class_name' => 'MarkdownExtension',
            'package' => 'twig/markdown-extra',
            'filters' => ['html_to_markdown', 'markdown_to_html'],
            'functions' => [],
        ],
        'intl' => [
            'name' => 'intl',
            'class' => IntlExtension::class,
            'class_name' => 'IntlExtension',
            'package' => 'twig/intl-extra',
            'filters' => ['country_name', 'currency_name', 'currency_symbol', 'language_name', 'locale_name', 'timezone_name',
                'format_currency', 'format_number', 'format_decimal_number', 'format_currency_number',
                'format_percent_number', 'format_scientific_number', 'format_spellout_number', 'format_ordinal_number',
                'format_duration_number', 'format_date', 'format_datetime', 'format_time',
            ],
            'functions' => ['country_timezones'],
        ],
        'cssinliner' => [
            'name' => 'cssinliner',
            'class' => CssInlinerExtension::class,
            'class_name' => 'CssInlinerExtension',
            'package' => 'twig/cssinliner-extra',
            'filters' => ['inline_css'],
            'functions' => [],
        ],
        'inky' => [
            'name' => 'inky',
            'class' => InkyExtension::class,
            'class_name' => 'InkyExtension',
            'package' => 'twig/inky-extra',
            'filters' => ['inky_to_html'],
            'functions' => [],
        ],
        'string' => [
            'name' => 'string',
            'class' => StringExtension::class,
            'class_name' => 'StringExtension',
            'package' => 'twig/string-extra',
            'filters' => ['u'],
            'functions' => [],
        ],
    ];

    public static function getClasses(): array
    {
        return array_column(self::EXTENSIONS, 'class', 'name');
    }

    public static function getFilter(string $name): array
    {
        foreach (self::EXTENSIONS as $extension) {
            if (\in_array($name, $extension['filters'])) {
                return [$extension['class_name'], $extension['package']];
            }
        }

        return [];
    }

    public static function getFunction(string $name): array
    {
        foreach (self::EXTENSIONS as $extension) {
            if (\in_array($name, $extension['functions'])) {
                return [$extension['class_name'], $extension['package']];
            }
        }

        return [];
    }
}

{'fraction_non_alphanumeric': 0.15619047619047619, 'fraction_numerical': 0.0, 'mean_word_length': 2.115472387037882, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 89, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1072491', 'n_tokens_mistral': 1994, 'n_tokens_neox': 1932, 'n_words': 370}