<commit_before><?php
namespace Ackintosh\Snidel;

class ForkCollection implements \ArrayAccess, \Iterator
{
    /** @var \Ackintosh\Snidel\Fork[] */
    private $forks = array();

    /** @var int */
    private $position;

    /**
     * @param   \Ackintosh\Snidel\Fork[]
     */
    public function __construct($forks)
    {
        array_map(function ($fork) {
            $this->forks[] = $fork;
        }, $forks);

        $this->position = 0;
    }

    /**
     * @return  array
     */
    public function toArray()
    {
        return array_map(
            function ($fork) {
                return $fork->getResult()->getReturn();
            },
            $this->forks
        );
    }

    /**
     * @param   mixed   $offset
     * @return  bool
     */
    public function offsetExists($offset)
    {
        if (isset($this->forks[$offset]) && $this->forks[$offset] !== '') {
            return true;
        }

        return false;
    }

    /**
     * @param   mixed   $offset
     * @return  mixed
     */
    public function offsetGet($offset)
    {
        if (!$this->offsetExists($offset)) {
            return null;
        }

        return $this->forks[$offset];
    }

    /**
     * @param   mixed   $offset
     * @return  void
     */
    public function offsetSet($offset, $value)
    {
        $this->forks[$offset] = $value;
    }

    /**
     * @param   mixed   $offset
     * @return  void
     */
    public function offsetUnset($offset)
    {
        unset($this->forks[$offset]);
    }

    /**
     * Iterator interface
     *
     * @return  \Ackintosh\Snidel\Fork
     */
    public function current()
    {
        return $this->forks[$this->position];
    }

    /**
     * Iterator interface
     *
     * @return  int
     */<commit_msg>Add doc comment<commit_after><?php
namespace Ackintosh\Snidel;

class ForkCollection implements \ArrayAccess, \Iterator
{
    /** @var \Ackintosh\Snidel\Fork[] */
    private $forks = array();

    /** @var int */
    private $position;

    /**
     * @param   \Ackintosh\Snidel\Fork[]
     */
    public function __construct($forks)
    {
        array_map(function ($fork) {
            $this->forks[] = $fork;
        }, $forks);

        $this->position = 0;
    }

    /**
     * @return  array
     */
    public function toArray()
    {
        return array_map(
            function ($fork) {
                return $fork->getResult()->getReturn();
            },
            $this->forks
        );
    }

    /**
     * ArrayAccess interface
     *
     * @param   mixed   $offset
     * @return  bool
     */
    public function offsetExists($offset)
    {
        if (isset($this->forks[$offset]) && $this->forks[$offset] !== '') {
            return true;
        }

        return false;
    }

    /**
     * ArrayAccess interface
     *
     * @param   mixed   $offset
     * @return  mixed
     */
    public function offsetGet($offset)
    {
        if (!$this->offsetExists($offset)) {
            return null;
        }

        return $this->forks[$offset];
    }

    /**
     * ArrayAccess interface
     *
     * @param   mixed   $offset
     * @return  void
     */
    public function offsetSet($offset, $value)
    {
        $this->forks[$offset] = $value;
    }

    /**
     * ArrayAccess interface
     *
     * @param   mixed   $offset
     * @return  void
     */
    public function offsetUnset($offset)
    {
        unset($this->forks[$offset]);
    }

    /**
     * Iterator interface
     *
     * @return  \Ackintosh\Snidel\Fork
     */
    public function current()
    {
        return $this->forks[$this->position];
    }

    /**
     * Iterator interface
     *
     * @return  int
     */
{'fraction_non_alphanumeric': 0.1461579795808705, 'fraction_numerical': 0.0005373455131649651, 'mean_word_length': 1.5378323108384457, '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': '5976071', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1138, 'n_words': 216}