<commit_before><?php

/**
 * @file
 *
 * @package In2pire
 * @subpackage Cli
 * @author <NAME> <<EMAIL>>
 */

namespace In2pire\Cli\Question;

use In2pire\Component\Utility\String;

final class Container
{
    public static function create($question, $command)
    {
        static $cache = [];
        $cacheKey = $question;

        if (isset($cache[$cacheKey]))  {
            $class = $cache[$cacheKey]['class'];
            $question = $cache[$cacheKey]['question'];
        } else {
            if (false === strpos($question, '.')) {
                // Not FQCN
                $class = __NAMESPACE__ . '\\' . String::convertToCamelCase($question);
            } else {
                // FQCN
                $class = explode('.', $question);
                $class = array_map(array('In2pire\\Component\\Utility\\String', 'convertToCamelCase'), $class);
                $class = implode('\\', $class);
                $question = substr($question, strrpos($question, '.') + 1);
            }

            $cache[$cacheKey] = [
                'class' => $class,
                'question' => $question
            ];
        }


        $class = __NAMESPACE__ . '\\' . Utility::convertToCamelCase($question);

        if (!class_exists($class)) {
            throw new \RuntimeException('Unknow question ' . $cacheKey);
        }

        return new $class($command);
    }
}
<commit_msg>Fix calling to wrong Utility class<commit_after><?php

/**
 * @file
 *
 * @package In2pire
 * @subpackage Cli
 * @author <NAME> <<EMAIL>>
 */

namespace In2pire\Cli\Question;

use In2pire\Component\Utility\String;

final class Container
{
    public static function create($question, $command)
    {
        static $cache = [];
        $cacheKey = $question;

        if (isset($cache[$cacheKey]))  {
            $class = $cache[$cacheKey]['class'];
            $question = $cache[$cacheKey]['question'];
        } else {
            if (false === strpos($question, '.')) {
                // Not FQCN
                $class = __NAMESPACE__ . '\\' . String::convertToCamelCase($question);
            } else {
                // FQCN
                $class = explode('.', $question);
                $class = array_map(array('In2pire\\Component\\Utility\\String', 'convertToCamelCase'), $class);
                $class = implode('\\', $class);
                $question = substr($question, strrpos($question, '.') + 1);
            }

            $cache[$cacheKey] = [
                'class' => $class,
                'question' => $question
            ];
        }

        if (!class_exists($class)) {
            throw new \RuntimeException('Unknow question ' . $cacheKey);
        }

        return new $class($command);
    }
}

{'fraction_non_alphanumeric': 0.16172703988291254, 'fraction_numerical': 0.003658982802780827, 'mean_word_length': 1.7869520897043834, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '4641899', 'n_tokens_mistral': 802, 'n_tokens_neox': 768, 'n_words': 150}