<commit_before><?php
namespace Hostnet\Component\EntityPlugin;

/**
 * Ugly hack to circumvent PHP autoloading the class that is typehinted
 * As it might not be autoloadable install-time
 * Examples of \ReflectionParameter->__toString():
 * Parameter #0 [ <required> DateTime $date ]
 * Parameter #0 [ <optional> DateTime or NULL $date = NULL ]
 * Parameter #0 [ <required> Hostnet\Component\EntityPlugin\ReflectionGenerator $generator ]
 */
class TypeHinter
{

    public function getTypeHint(\ReflectionParameter $parameter)
    {
        if ($parameter->isArray()) {
            return 'array ';
        }
        $matches = [];
        preg_match('/\[\s\<\w+?>\s([\\\\\w]+)/s', $parameter->__toString(), $matches);
        if (isset($matches[1])) {
            return '\\' . $matches[1] . ' ';
        }<commit_msg>not using new array notation<commit_after><?php
namespace Hostnet\Component\EntityPlugin;

/**
 * Ugly hack to circumvent PHP autoloading the class that is typehinted
 * As it might not be autoloadable install-time
 * Examples of \ReflectionParameter->__toString():
 * Parameter #0 [ <required> DateTime $date ]
 * Parameter #0 [ <optional> DateTime or NULL $date = NULL ]
 * Parameter #0 [ <required> Hostnet\Component\EntityPlugin\ReflectionGenerator $generator ]
 */
class TypeHinter
{

    public function getTypeHint(\ReflectionParameter $parameter)
    {
        if ($parameter->isArray()) {
            return 'array ';
        }
        $matches = array();
        preg_match('/\[\s\<\w+?>\s([\\\\\w]+)/s', $parameter->__toString(), $matches);
        if (isset($matches[1])) {
            return '\\' . $matches[1] . ' ';
        }
{'fraction_non_alphanumeric': 0.1530120481927711, 'fraction_numerical': 0.006024096385542169, 'mean_word_length': 2.983213429256595, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, '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': '2532781', 'n_tokens_mistral': 474, 'n_tokens_neox': 472, 'n_words': 125}