src/CartesianProduct.php
private function addSet($set)
    {
        if (is_array($set)) {
            $set = new \ArrayIterator($set);
        } elseif ($set instanceof \Traversable) {
            $set = new \IteratorIterator($set);
        } else {
            throw new \InvalidArgumentException('Set must be either an array or Traversable');
        }

        $this->sets[] = $set;
    }
private function addSet($set)
    {
        if (is_array($set)) {
            $set = new \ArrayIterator($set);
        } elseif ($set instanceof \Traversable) {
            $set = new \IteratorIterator($set);
        } else {
            throw new \InvalidArgumentException('Set must be either an array or Traversable');
        }

        $this->sets[] = $set;
    }
Adds a set.

@param array|Traversable $set

@throws \InvalidArgumentException