<commit_before><?php

function create_callable($type, $mode)
{
    switch ($type) {
        case 'method':
            return [new TestClass(), 'method'.camelize($mode)];

        case 'static_method':
            return ['TestClass', 'staticMethod'.camelize($mode)];

        case 'invoked_method':
            return (new ReflectionClass('Invoke'.camelize($mode).'Class'))->newInstance();

        case 'closure':
            return (new ReflectionFunction('function_'.$mode))->getClosure();

        case 'function':
            return 'function_'.$mode;
    }
}

function camelize($string)
{
    return str_replace(' ', '', ucwords(str_replace('_', ' ', $string)));
}
<commit_msg>Throw an exception on an unsupported callable type<commit_after><?php

function create_callable($type, $mode)
{
    switch ($type) {
        case 'method':
            return [new TestClass(), 'method'.camelize($mode)];

        case 'static_method':
            return ['TestClass', 'staticMethod'.camelize($mode)];

        case 'invoked_method':
            return (new ReflectionClass('Invoke'.camelize($mode).'Class'))->newInstance();

        case 'closure':
            return (new ReflectionFunction('function_'.$mode))->getClosure();

        case 'function':
            return 'function_'.$mode;
    }

    throw new \InvalidArgumentException(sprintf('Unsupported callable type "%s".', $type));
}

function camelize($string)
{
    return str_replace(' ', '', ucwords(str_replace('_', ' ', $string)));
}

{'fraction_non_alphanumeric': 0.16555407209612816, 'fraction_numerical': 0.0, 'mean_word_length': 3.073369565217391, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3691939', 'n_tokens_mistral': 438, 'n_tokens_neox': 424, 'n_words': 88}