<commit_before><?php

namespace SandFoxMe\Bencode\Types;

use SandFoxMe\Bencode\Exceptions\InvalidArgumentException;

class ListType implements \IteratorAggregate
{
    private $iterable;

    /**
     * ArrayType constructor.
     * @param $arrayOrTraversable
     */
    public function __construct($arrayOrTraversable)
    {
        if (is_array($arrayOrTraversable) === false && ($arrayOrTraversable instanceof \Traversable) === false) {
            throw new InvalidArgumentException('$arrayOrTraversable must be an array or implement \Traversable');
        }

        $this->iterable = $arrayOrTraversable;
    }

    public function getIterator()
    {
        return $this->iterable;
    }
}<commit_msg>simplify ListType by accepting traversable only<commit_after><?php

namespace SandFoxMe\Bencode\Types;

class ListType implements \IteratorAggregate
{
    private $traversable;

    /**
     * ArrayType constructor.
     * @param \Traversable $traversable
     */
    public function __construct(\Traversable $traversable)
    {
        $this->traversable = $traversable;
    }

    public function getIterator()
    {
        return $this->traversable;
    }
}
{'fraction_non_alphanumeric': 0.0988917306052856, 'fraction_numerical': 0.0, 'mean_word_length': 3.119298245614035, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '6850435', 'n_tokens_mistral': 345, 'n_tokens_neox': 336, 'n_words': 72}