<commit_before><?php

namespace Monomelodies\Reflex;

class ReflectionParameter extends \ReflectionParameter
{
    public function getNormalisedType($param = null) : string
    {
        if (!isset($param)) {
            $param = $this->getType();
        }
        if (is_object($param)) {
            if ($compare = $this->getType()) {
                $compare = $compare->__toString();
                if ($param instanceof $compare) {
                    return $compare;
                }
            }
            return get_class($param);
        }
        if (is_callable($param)) {
            return 'callable';
        }
        $type = gettype($param);
        switch ($type) {
            case 'integer': return 'int';
            case 'boolean': return 'bool';
            case 'double': return 'float';
            default: return $type;
        }
    }
}
<commit_msg>correctly identify closures as callable<commit_after><?php

namespace Monomelodies\Reflex;

use Closure;

class ReflectionParameter extends \ReflectionParameter
{
    public function getNormalisedType($param = null) : string
    {
        if (!isset($param)) {
            $param = $this->getType();
        }
        if (is_object($param) && !($param instanceof Closure)) {
            if ($compare = $this->getType()) {
                $compare = $compare->__toString();
                if ($param instanceof $compare) {
                    return $compare;
                }
            }
            return get_class($param);
        }
        if (is_callable($param)) {
            return 'callable';
        }
        $type = gettype($param);
        switch ($type) {
            case 'integer': return 'int';
            case 'boolean': return 'bool';
            case 'double': return 'float';
            case 'Closure': return 'callable';
            default: return $type;
        }
    }
}

{'fraction_non_alphanumeric': 0.12679045092838195, 'fraction_numerical': 0.0, 'mean_word_length': 1.6414565826330532, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '489734', 'n_tokens_mistral': 499, 'n_tokens_neox': 490, 'n_words': 121}