Returns the widget type by name.

@param string $name
@return WidgetTypeInterface
@throws \InvalidArgumentException
490353
public function getType($name)
    {
        if ($this->hasType($name)) {
            return $this->types[$name];
        } else {
            throw new \InvalidArgumentException(sprintf('Widget type "%s" not found.', $name));
        }
    }
1071376
public function get($name)
    {
        if (!isset($this->helpers[$name])) {
            throw new \InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name));
        }

        return $this->helpers[$name];
    }
974556
public function getBranding($name)
    {
        foreach ($this->brandings as $branding) {
            if ($branding->getName() === $name) {
                return $branding;
            }
        }

        $names = array_map(function ($branding) {
            return $branding->getName();
        }, $this->brandings);

        throw new \InvalidArgumentException(sprintf('No branding named "%s". Available are: %s.', $name, implode(', ', $names)));
    }
948798
public function get(string $name) : EventHandlerInterface
    {
        if (!isset($this->eventHandlers[$name])) {
            throw new \InvalidArgumentException(sprintf('DataGrid event handler %s not found', $name));
        }

        return $this->eventHandlers[$name];
    }
1176711
public function widget(string $widgetType): WidgetInterface
    {
        //====================================================================//
        // Build Widgets Type Index Key
        $index = get_class($this->getConnector())."::".$widgetType;

        //====================================================================//
        // If Widgets Manager is New
        if (!isset($this->widgetManagers[$index])) {
            $this->widgetManagers[$index] = new Manager($this->getConnector(), $widgetType);
        }

        //====================================================================//
        // Return Widgets Manager
        return $this->widgetManagers[$index];
    }
342647
public function getOption($name) {
    if (!array_key_exists($name, $this->options)) {
      throw new InvalidArgumentException(sprintf('Undefined option: "%s"', $name));
    }

    return $this->options[$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];
    }
1057523
public function getOption($name) {
        if(!isset($this->options[$name])){
            throw new InvalidArgumentException(sprintf("The option name '%s' is invalid, available are %s.",$name, implode(",",array_keys($this->options))));
        }
        return $this->options[$name];
    }
1222607
public function getConfigurator(string $name): FieldSetConfigurator
    {
        if (!isset($this->configurators[$name])) {
            if (isset($this->serviceIds[$name])) {
                $configurator = $this->container->get($this->serviceIds[$name]);
            } elseif (class_exists($name)) {
                // Support fully-qualified class names.
                $configurator = new $name();
            } else {
                throw new InvalidArgumentException(sprintf('Could not load FieldSet configurator "%s".', $name));
            }

            if (!$configurator instanceof FieldSetConfigurator) {
                throw new InvalidArgumentException(sprintf('Configurator class "%s" is expected to be an instance of '.FieldSetConfigurator::class, $name));
            }

            $this->configurators[$name] = $configurator;
        }

        return $this->configurators[$name];
    }
818880
public function getServiceType($name)
    {
        if (isset($this->types[$name])) {
            return $this->types[$name];
        }

        return null;
    }
905440
public function getPropertyType(string $name)
    {
        return isset($this->propertyTypeMap[$name]) ? $this->propertyTypeMap[$name] : null;
    }
453511
public function getType($name)
    {
        if (class_exists($name) || interface_exists($name)) {
            if ($this->hasTypeForClass($name)) {
                $name = $this->getTypeForClass($name);
            }
        }

        if (!$this->hasType($name)) {
            throw new \UnexpectedValueException(sprintf('Does not exist a valid definition for "%s" type', $name));
        }

        return $this->types[$name];
    }
578875
public function getMethod($name)
    {
        if ($this->hasMethod($name) === true) {
            return $this->methods[$name];
        } else {
            throw new InvalidArgumentException('Method "' . $name . '" is not defined.');
        }
    }
321293
public function get($name)
    {
        if ($this->has($name)) {
            return $this->elements[$name];
        }

        throw new \InvalidArgumentException(sprintf('Element "%s" does not exist.', $name));
    }
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];
    }
939304
public function getDefinitionByName($name)
    {
        if (!array_key_exists($name, $this->definitions)) {
            throw new \InvalidArgumentException(sprintf('Can\'t find "%s" Definition.', $name));
        }

        return $this->definitions[$name];
    }
705654
public static function get($name): Type
    {
        //internal type
        if ($internalType = self::getInternalType($name)) {
            return $internalType;
        }

        //convert FQCN into type,
        //allowing the use of FQCN for GraphQL scalar types
        if (class_exists($name) || interface_exists($name)) {
            if (\in_array($name, self::$typesMap, true)) {
                $name = array_flip(self::$typesMap)[$name];
            } elseif (self::$endpoint->hasTypeForClass($name)) {
                $name = self::$endpoint->getTypeForClass($name);
            }
        }

        if (!self::has($name)) {
            self::create($name);
        }

        if (self::has($name)) {
            return self::$types[$name];
        }

        throw new InvalidTypeException($name);
    }