Converts name to class

@param string  $name
@param integer $type

@return string

@throws InvalidArgumentException
426960
public static function nameToClass($name, $type)
    {
        if (!isset(self::$masks[$type])) {
            throw new InvalidArgumentException(
                "Invalid mask type " . $type . "!"
            );
        }
        return str_replace("*", $name, self::$masks[$type]);
    }
862801
private function resolveClassName(string $type = null): string
    {
        if ($type === null) {
            throw new \InvalidArgumentException('Component type is not provided.');
        }
        $class = self::$dict[$type] ?? camelize($type);
        return $this->namespace . '\\' . $class . $this->suffix;
    }
360413
public function getOption($name, $type = null)
    {
        $type = $type ?: $this->getTypeByName($name);
        if (!isset($this->options[$name]) && class_exists($name)) {
            $name = array_search($name, $this->mapping[$type]) ?: $name;
        }
        if (!isset($this->options[$name])) {
            $option = $this->createOption($name, $type);
            $name = $option->getName();
            $this->options[$name] = $option;
            if (!isset($this->mapping[$type][$name])) {
                $this->mapping[$type][$name] = get_class($option);
            }
        }

        return $this->options[$name];
    }
465940
public static function get($name)
    {
        if (!isset(self::$converterMap[$name])) {
            throw new InvalidArgumentException(sprintf('Attribute converter "%s" is not valid.', $name));
        }

        return self::getInstanceOfConverter($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);
	}
701238
public function getColumn(string $name) : Column
    {
        $column = $this->findColumn($name);

        if (!$column) {
            throw InvalidArgumentException::format(
                'Could not get column from table \'%s\': expecting one of (%s), \'%s\' given',
                $this->name, Debug::formatValues($this->getColumnNames()), $name
            );
        }

        return $column;
    }
730333
private function getKey(string $name, string $type = self::TYPE_QUEUE) : string
    {
        return $name . ':' . $type;
    }
1072141
public function getFirstByNameType( $name, $type, $config = [] ) {

		$modelClass = static::$modelClass;

		return $modelClass::findFirstByNameType( $name, $type, $config );
	}
1086432
public static function getByName($name)
    {
        $name = (string)$name;
        $class = get_called_class();
        if (isset(self::$instances[$class][$name])) {
            return self::$instances[$class][$name];
        }
        $const = $class . '::' . $name;
        if (!defined($const)) {
            throw new \InvalidArgumentException($const . ' not defined');
        }
        return self::$instances[$class][$name] = new $class(constant($const));
    }
506875
private function parseRequiredClass($name, array $input, $type)
    {
        if (isset($input[$name]) && $input[$name] instanceof $type) {
            return $input[$name];
        }

        throw new Exception(sprintf("'%s' must be an instance of '%s'.", $name, $type));
    }
723141
public function argument($type, $name) {
        $argument = new Argument($type, $name);
        $this->addArgument($argument);

        return $argument;
    }
960636
public function create($name, $type, array $options)
    {
        if (is_string($type)) {
            $type = $this->registry->getType($type);
        }
        if (!$type instanceof WidgetTypeInterface) {
            throw new \InvalidArgumentException('Unexpected widget type.');
        }

        $options['name'] = $name;

        $resolver = new OptionsResolver();
        $type->configureOptions($resolver);
        $options = $resolver->resolve($options);

        $widget = new Widget($name, $type);
        $type->buildWidget($widget, $options);

        return $widget;
    }
325237
public function getByName(string $name): Conversion
    {
        $conversion = $this->first(function (Conversion $conversion) use ($name) {
            return $conversion->getName() === $name;
        });

        if (! $conversion) {
            throw InvalidConversion::unknownName($name);
        }

        return $conversion;
    }
1354009
public static function passive(string $name, Type $type): self
    {
        $self = new self($name, $type);
        $self->passive = true;

        return $self;
    }
828841
public function getType($type_name)
    {
        if (isset($this->types[$type_name])) {
            return $this->types[$type_name];
        } else {
            throw new InvalidArgumentException("Type '$type_name' not found");
        }
    }
260333
public function restore($type, $name)
    {
        if (!is_string($type) || !isset($this->algos[$type])) {
            throw new \InvalidArgumentException();
        }
        if (isset($this->savedAlgos[$type][$name])) {
            $this->algos[$type][$name] = $this->savedAlgos[$type][$name];
        }
        return $this;
    }
1233450
public static function autoDelete(string $name, Type $type): self
    {
        $self = new self($name, $type);
        $self->autoDelete = true;
        $self->durable = false;

        return $self;
    }