<commit_before><?php

namespace Framework\Config;

trait Base
{
    /**
     *
     */
    use ArrayAccess;

    /**
     * @var array
     */
    protected $config = [];

    /**
     * @param array $config
     */
    public function __construct(array $config = [])
    {
        $this->config = $config;
    }

    /**
     * @return int
     */
    public function count()
    {
        return count($this->config);
    }

    /**
     * @return mixed
     */
    public function current()
    {
        return current($this->config);
    }

    /**
     * @param string $name
     * @return mixed
     */
    public function get($name)
    {
        return isset($this->config[$name]) ? $this->config[$name] : null;
    }

    /**
     * @param string $name
     * @return bool
     */
    public function has($name)
    {
        return isset($this->config[$name]);
    }

    /**
     * @return mixed
     */
    public function key()
    {
        return key($this->config);
    }

    /**
     * @return void
     */
    public function next()
    {
        next($this->config);
    }

    /**
     * @param string $name
     * @return void
     */
    public function remove($name)
    {
        unset($this->config[$name]);
    }

    /**
     *
     */
    public function rewind()
    {
        reset($this->config);
    }

    /**
     * @param string $name
     * @param mixed $config
     * @return void
     */
    public function set($name, $config)
    {
        $this->config[$name] = $config;
    }

    /**
     * @return bool
     */
    public function valid()
    {
        return array_key_exists($this->key(), $this->config);
    }
}<commit_msg>fix config iteration of false values<commit_after><?php

namespace Framework\Config;

trait Base
{
    /**
     *
     */
    use ArrayAccess;

    /**
     * @var array
     */
    protected $config = [];

    /**
     * @param array $config
     */
    public function __construct(array $config = [])
    {
        $this->config = $config;
    }

    /**
     * @return int
     */
    public function count()
    {
        return count($this->config);
    }

    /**
     * @return mixed
     */
    public function current()
    {
        return current($this->config);
    }

    /**
     * @param string $name
     * @return mixed
     */
    public function get($name)
    {
        return isset($this->config[$name]) ? $this->config[$name] : null;
    }

    /**
     * @param string $name
     * @return bool
     */
    public function has($name)
    {
        return array_key_exists($name, $this->config);
    }

    /**
     * @return mixed
     */
    public function key()
    {
        return key($this->config);
    }

    /**
     * @return void
     */
    public function next()
    {
        next($this->config);
    }

    /**
     * @param string $name
     * @return void
     */
    public function remove($name)
    {
        unset($this->config[$name]);
    }

    /**
     *
     */
    public function rewind()
    {
        reset($this->config);
    }

    /**
     * @param string $name
     * @param mixed $config
     * @return void
     */
    public function set($name, $config)
    {
        $this->config[$name] = $config;
    }

    /**
     * @return bool
     */
    public function valid()
    {
        return $this->has($this->key());
    }
}
{'fraction_non_alphanumeric': 0.15787905868334823, 'fraction_numerical': 0.0, 'mean_word_length': 1.5022354694485842, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '3471239', 'n_tokens_mistral': 1045, 'n_tokens_neox': 1026, 'n_words': 213}