<commit_before><?php

namespace Underbar;

class Wrapper implements \IteratorAggregate
{
    private $value;

    private $class;

    public function __construct($value, $class)
    {
        $this->value = $value;
        $this->class = $class;
    }

    public function __call($name, $aruguments)
    {
        array_unshift($aruguments, $this->value);
        $value = call_user_func_array(array($this->class, $name), $aruguments);
        return new static($value, $this->class);
    }

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

    public function getIterator()
    {
        if ($this->value instanceof \Traversable) {
            return $this->value;
        } else {
            return new \ArrayIterator((array) $this->value);
        }
    }
}

// __END__
// vim: expandtab softtabstop=4 shiftwidth=4<commit_msg>Add strict() and lazy() on Wrapper<commit_after><?php

namespace Underbar;

class Wrapper implements \IteratorAggregate
{
    private $value;

    private $class;

    public function __construct($value, $class)
    {
        $this->value = $value;
        $this->class = $class;
    }

    public function __call($name, $aruguments)
    {
        array_unshift($aruguments, $this->value);
        $value = call_user_func_array(array($this->class, $name), $aruguments);
        return new static($value, $this->class);
    }

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

    public function strict()
    {
        $this->class = __NAMESPACE__ . '\\Strict';
        return $this;
    }

    public function lazy()
    {
        $this->class = __NAMESPACE__ . '\\Lazy';
        return $this;
    }

    public function getIterator()
    {
        if ($this->value instanceof \Traversable) {
            return $this->value;
        } else {
            return new \ArrayIterator((array) $this->value);
        }
    }
}

// __END__
// vim: expandtab softtabstop=4 shiftwidth=4
{'fraction_non_alphanumeric': 0.13223987698616094, 'fraction_numerical': 0.0020502306509482316, 'mean_word_length': 2.2642140468227425, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3481880', 'n_tokens_mistral': 601, 'n_tokens_neox': 594, 'n_words': 134}