Returns instance of the renderer

@param  string            $name Name of the renderer
@return IRenderer Renderer instance

@throws InvalidArgumentException If the renderer with given name does not exist
488274
public function getRenderer($name)
    {
        // default
        if ($name === null) {
            if ($this->defaultRenderer !== null) {
                $name = $this->defaultRenderer;
            } else if (count($this->renderers) > 0) {
                $name = key($this->renderers);
            }
        }

        if (!isset($this->renderers[$name])) {
            throw new InvalidArgumentException("Renderer with name '$name' doesn't exist.");
        }

        if (is_string($this->renderers[$name])) {
            $renderer = new $this->renderers[$name]();
            $reflection = ClassType::from($renderer);
            if (!$reflection->isSubclassOf('Smf\Menu\Renderer\IRenderer')) {
                throw new InvalidArgumentException("Renderer class '{$this->renderers[$name]}' is not subclass of Smf\\Menu\\Renderer\\IRenderer");
            }
            $this->renderers[$name] = $renderer;
        }

        return $this->renderers[$name];
    }
832011
public function get($name)
    {
        if (!isset($this->formats[$name])) {
            throw new \InvalidArgumentException(sprintf(
                'Unknown format "%s", known formats: "%s"',
                $name, implode(', ', array_keys($this->formats))
            ));
        }

        return $this->formats[$name];
    }
1370070
public function loadRenderer($type)
	{
		$class = __NAMESPACE__ . '\\Type\\' . ucfirst($this->_type) . '\\' . ucfirst($type);

		if (!class_exists($class))
		{
			throw new \InvalidArgumentException(\Lang::txt('Unable to load renderer class'), 500);
		}

		return new $class($this);
	}
345046
public function get($name)
    {
        if ($this->cache->has($name)) {
            return $this->loader->load($this->cache->get($name));
        }

        if (!$this->cache->isFresh()) {
            $this->refresh();

            return $this->get($name);
        }

        throw new \InvalidArgumentException(sprintf(
            'Unknown resource named "%s" for the host "%s"',
            $name,
            $this->host
        ));
    }
481212
public function getField($name)
    {
        if ($this->has($name)) {
            return $this->fields[$name];
        }

        throw new \InvalidArgumentException(
            'Field with name ['. $name .'] does not exist in class '.get_class($this)
        );
    }
156434
public function get($name)
    {
        if (array_key_exists($name, $this->transformations)) {
            return $this->transformations[$name];
        }

        throw new \InvalidArgumentException(
            sprintf(
                'A image transformation transformation named "%s" does not exist.',
                $name
            )
        );
    }
904294
public function getFormatter($name)
    {
        $formatters = $this->getFormatters();
        if (!array_key_exists($name, $formatters)) {
            list($module, $exporter) = explode('-', $name, 2);
            $class = sprintf('\\MwbExporter\\Formatter\\%s\\%s\\Formatter', ucfirst(strtolower($module)), ucfirst(strtolower($exporter)));
            if (!class_exists($class)) {
                throw new \InvalidArgumentException(sprintf('Unknown formatter "%s".', $name));
            }
        } else {
            $class = $formatters[$name];
        }

        return new $class($name);
    }
101770
public function get(string $name): EncoderInterface
    {
        if (!isset($this->encoders[$name])) {
            throw new \InvalidArgumentException('There is no encoder registered with name '.$name);
        }

        return $this->encoders[$name];
    }
758522
public function getWriter($name)
    {
        $class = sprintf('\\MwbExporter\\Writer\\%sWriter', ucfirst($name));
        if (class_exists($class)) {
            $writter = new $class();

            return $writter;
        }

        throw new \InvalidArgumentException(sprintf('Writer %s not found.', $class));
    }
513609
public function getClient(string $name = 'default')
    {
        if (!isset($this->clients[$name])) {
            throw new InvalidArgumentException("No client with name \"$name\"");
        }

        return $this->clients[$name];
    }
73043
protected function instance($name)
    {
        $methodName = $this->methodName($name);

        return $this->objectBuild($name, $methodName);
    }
586213
public function getParameter($name)
    {
        if (!array_key_exists($name, $this->parameters)) {
            throw new InvalidArgumentException(sprintf('Parameter: "%s" does not exist', $name));
        }

        return $this->parameters[$name];
    }
927327
public function getCollector($name)
    {
        if (!isset($this->data['collectors'][$name])) {
            throw new InvalidArgumentException("Invalid debug collector '$name'");
        }

        return $this->data['collectors'][$name];
    }
1103158
public function getArgument($name) {
        if (!$this->definition->hasArgument($name)) {
            throw new \InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
        }

        return isset($this->arguments[$name]) ? $this->arguments[$name] : $this->definition->getArgument($name)
            ->getDefault();
    }
57381
public function setDefaultRenderer($name)
    {
        if (!\array_key_exists($name, $this->renderers)) {
            throw new \InvalidArgumentException(sprintf('Cannot set default exception renderer "%s". It does not exist.', $name));
        }

        $this->defaultRenderer = $name;
    }
1102665
public static function getInstance( $name )
    {
        if (! isset( self::$instances[$name] ) )
            self::$instances[$name] = new self( $name );

        return self::$instances[$name];
    }
2960
public function getRenderer()
    {
        if (null === $this->renderer) {
            $this->setRenderer(new Renderer($this));
        }
        return $this->renderer;
    }