<commit_before><?php

namespace Galahad\LaravelAddressing;

/**
 * Class Entity
 *
 * @package Galahad\LaravelAddressing
 * @author <NAME> <<EMAIL>>
 */
class Entity
{
    /**
     * Get property if get method exists
     *
     * @param $name
     * @return mixed
     */
    function __get($name)
    {
        $name = array_walk(explode('_', $name), 'ucfirst'); // some_name => ['Some', 'Name']
        $name = implode('', $name); // SomeName
        $method = 'get'.$name;
        if (method_exists($this, $method)) {
            return $this->$method();
        }
    }
}<commit_msg>Fix bug in __get method<commit_after><?php

namespace Galahad\LaravelAddressing;

/**
 * Class Entity
 *
 * @package Galahad\LaravelAddressing
 * @author <NAME> <<EMAIL>>
 */
class Entity
{
    /**
     * Get property if get method exists
     *
     * @param $name
     * @return mixed
     */
    function __get($name)
    {
        $name = array_map('ucfirst', explode('_', $name)); // some_name => ['Some', 'Name']
        $name = implode('', $name); // SomeName
        $method = 'get'.$name;
        if (method_exists($this, $method)) {
            return $this->$method();
        }
    }
}
{'fraction_non_alphanumeric': 0.17383966244725738, 'fraction_numerical': 0.0, 'mean_word_length': 2.3036211699164344, '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': '1493878', 'n_tokens_mistral': 388, 'n_tokens_neox': 384, 'n_words': 88}