<commit_before><?php defined('ALT_PATH') OR die('No direct access allowed.');

class Alt_Component {

    public static $folder = "component";
    public $_data = array();
    public $_html = "";

    public function __construct($location, $data = array())
    {
        $this->_data = $data;
        foreach($data as $key => $value){
            $this->{$key} = $value;
        }

        ob_start();

        /** @noinspection PhpIncludeInspection */
        /** @noinspection PhpUndefinedConstantInspection */
        include ALT_PATH . self::$folder . DIRECTORY_SEPARATOR . $location . ".php";

        $this->_html = ob_get_contents() ? ob_get_contents() : "";
        ob_end_clean();
    }

    public function __toString()
    {
        return $this->_html;
    }

    public static function load($location, $data = array())
    {
        return new self($location, $data);
    }

    public function __get($name)
    {
        return isset($this->_data[$name]) ? $this->_data[$name] : $this->{$name};
    }

    public function __set($name, $value)
    {
        if(isset($this->{$name})){
            $this->{$name} = $value;
        }else{
            $this->_data[$name] = $value;
        }
        return $this;
    }
}<commit_msg>component<commit_after><?php defined('ALT_PATH') OR die('No direct access allowed.');

class Alt_Component {

    public static $folder = "component";
    public $_data = array();
    public $_html = "";

    public function __construct($location, $data = array())
    {
        $this->_data = $data;
        foreach($data as $key => $value){
            $this->{$key} = $value;
        }

        ob_start();

        /** @noinspection PhpIncludeInspection */
        /** @noinspection PhpUndefinedConstantInspection */
        include ALT_PATH . self::$folder . DIRECTORY_SEPARATOR . $location . ".php";

        $this->_html = ob_get_contents() ? ob_get_contents() : "";
        ob_end_clean();
    }

    public function __toString()
    {
        return $this->_html;
    }

    public static function load($location, $data = array())
    {
        return new self($location, $data);
    }
}
{'fraction_non_alphanumeric': 0.1566152407667134, 'fraction_numerical': 0.0, 'mean_word_length': 2.317829457364341, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '6680000', 'n_tokens_mistral': 645, 'n_tokens_neox': 628, 'n_words': 141}