public function addVariables($variables)
    {
        if ($variables instanceof stdClass) {
            $variables = (array) $variables;
        } elseif ($variables instanceof Traversable) {
            $variables = iterator_to_array($variables);
        } elseif (! is_array($variables)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid variables provided; must be an array or Traversable '
                . 'or instance of stdClass, "%s" received.',
                is_object($variables) ? get_class($variables) : gettype($variables)
            ));
        }
        $this->container = array_merge($this->container, $variables);

        return $this;
    }