public function merge($source)
    {
        if ($source instanceof MergingInterface) {
            $source = $source->toArray();
        } elseif ($source instanceof Traversable) {
            $source = iterator_to_array($source);
        } elseif ($source instanceof \stdClass) {
            $source = (array) $source;
        } elseif (! is_array($source)) {
            throw new InvalidArgumentException(sprintf(
                'Failed to merge with source of type "%s".',
                is_object($source) ? get_class($source) : gettype($source)
            ));
        }
        $this->container = $this->arrayMerge($this->container, $source);
    }