<commit_before><?php

namespace Spatie\Emoji;

use Spatie\Emoji\Exceptions\UnknownCharacter;
use Spatie\Emoji\Exceptions\CouldNotDetermineFlag;

/**
 * Emoji class.
 *
 * @link {{ url }}
 * @version {{ version }}
 * loaded at: {{ loaded_at|date('Y-m-d H:i:s') }}
 *
{% for group, subgroups in groups %}
 * ##### Emoji group: {{ group|upper }} #####
{% for subgroup, emojis in subgroups %}
 * ##### Emoji subgroup: {{ subgroup|upper }} #####
{% for emoji in emojis %}
 * @method static string {{ emoji.method }}()
{% endfor %}
{% endfor %}
{% endfor %}
 */
class Emoji
{
{% for group, subgroups in groups %}
    // ##### Emoji group: {{ group|upper }} #####
{% for subgroup, emojis in subgroups %}
    // ##### Emoji subgroup: {{ subgroup|upper }} #####
{% for emoji in emojis %}
    const {{ emoji.const }} = "{{ emoji.code }}";
{% endfor %}
{% endfor %}
{% endfor %}

    public static function getCharacter(string $characterName) : string
    {
        $constantName = static::convertCharacterNameToConstantName($characterName);

        if (! defined("static::{$constantName}")) {
            throw UnknownCharacter::create($characterName);
        }

        return constant('static::'.$constantName);
    }

    public static function countryFlag(string $countryCode) : string
    {
        if (strlen($countryCode) !== 2) {
            throw CouldNotDetermineFlag::countryCodeLenghtIsWrong($countryCode);
        }

        $countryCode = strtoupper($countryCode);<commit_msg>catch a missing mb_ function<commit_after><?php

namespace Spatie\Emoji;

use Spatie\Emoji\Exceptions\UnknownCharacter;
use Spatie\Emoji\Exceptions\CouldNotDetermineFlag;

/**
 * Emoji class.
 *
 * @link {{ url }}
 * @version {{ version }}
 * loaded at: {{ loaded_at|date('Y-m-d H:i:s') }}
 *
{% for group, subgroups in groups %}
 * ##### Emoji group: {{ group|upper }} #####
{% for subgroup, emojis in subgroups %}
 * ##### Emoji subgroup: {{ subgroup|upper }} #####
{% for emoji in emojis %}
 * @method static string {{ emoji.method }}()
{% endfor %}
{% endfor %}
{% endfor %}
 */
class Emoji
{
{% for group, subgroups in groups %}
    // ##### Emoji group: {{ group|upper }} #####
{% for subgroup, emojis in subgroups %}
    // ##### Emoji subgroup: {{ subgroup|upper }} #####
{% for emoji in emojis %}
    const {{ emoji.const }} = "{{ emoji.code }}";
{% endfor %}
{% endfor %}
{% endfor %}

    public static function getCharacter(string $characterName) : string
    {
        $constantName = static::convertCharacterNameToConstantName($characterName);

        if (! defined("static::{$constantName}")) {
            throw UnknownCharacter::create($characterName);
        }

        return constant('static::'.$constantName);
    }

    public static function countryFlag(string $countryCode) : string
    {
        if (strlen($countryCode) !== 2) {
            throw CouldNotDetermineFlag::countryCodeLenghtIsWrong($countryCode);
        }

        $countryCode = mb_strtoupper($countryCode);
{'fraction_non_alphanumeric': 0.1790744466800805, 'fraction_numerical': 0.0006706908115358819, 'mean_word_length': 3.5128593040847202, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6790314', 'n_tokens_mistral': 952, 'n_tokens_neox': 915, 'n_words': 201}