<commit_before><?php

namespace Data;

abstract class ModelAbstract implements ModelInterface
{
    protected $_data;

    protected $_dirty = [];

    public function isDirty()
    {
        return (0 < count($this->_dirty));
    }

    public function getAttributes($filter = null)
    {
        return [];
    }

    public function getRelationships($filter = null)
    {
        return [];
    }

    public function get($key)
    {

    }

    public function set($key, $value)
    {
        return $this;
    }

    public function __get($key)
    {
        $key = $this->inflectKey($key);
        $this->get($key);
    }

    public function __set($key, $value)
    {
        $key = $this->inflectKey($key);
        $this->set($key, $value);
    }

    protected function inflectKey($key)
    {
        return $key;
    }
}<commit_msg>internal value getter/ setter<commit_after><?php

namespace Data;

use Symfony\Component\PropertyAccess\PropertyAccess;

abstract class ModelAbstract implements ModelInterface
{
    protected $_data;

    protected $_dirty = [];

    public function isDirty()
    {
        return (0 < count($this->_dirty));
    }

    public function getAttributes($filter = null)
    {
        return [];
    }

    public function getRelationships($filter = null)
    {
        return [];
    }

    public function get($key)
    {

    }

    public function set($key, $value)
    {
        return $this;
    }

    public function __get($key)
    {
        $key = $this->inflectKey($key);
        $this->get($key);
    }

    public function __set($key, $value)
    {
        $key = $this->inflectKey($key);
        $this->set($key, $value);
    }

    protected function inflectKey($key)
    {
        return $key;
    }

    protected function inflectAccessorPath($path)
    {
        return '[' . str_replace('.', '][', $path) . ']';
    }

    protected function getDataValue($key)
    {
        $accessor = self::getPropertyAccessor();

        $path = $this->inflectAccessorPath($key);

        if ($accessor->isReadable($this->_dirty, $path)) {
            return $accessor->getValue($this->_dirty, $path);
        }

        return $accessor->getValue($this->_data, $path);
    }

    protected function setDataValue($key, $value)
    {
        $accessor = self::getPropertyAccessor();

        $path = $this->inflectAccessorPath($key);

        $accessor->setValue($this->_dirty, $path);

        return $this;
    }

    static protected function getPropertyAccessor()
    {
        static $accessor;

        if (!isset($accessor)) {
            $accessor = PropertyAccess::createPropertyAccessor();
        }

        return $accessor;
    }
}
{'fraction_non_alphanumeric': 0.13886820551005213, 'fraction_numerical': 0.0007446016381236039, 'mean_word_length': 2.2064439140811456, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, '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': '5134916', 'n_tokens_mistral': 810, 'n_tokens_neox': 779, 'n_words': 163}