Adds namespaces and aliases from constructor

@param array $args namespaces and classes to use in the template
971640
public function addUses($args)
    {
        foreach ((array)$args as $key => $value) {
            $value = str_replace('/', '\\', $value);
            if (is_int($key)) {
                // namespace or class import
                if (class_exists($value)) {
                    // class import
                    $this->aliases[StringHelper::basename($value)] = $value;
                } else {
                    // namespace
                    $this->namespaces[] = $value;
                }
            } else {
                // aliased class import
                $this->aliases[$key] = $value;
            }
        }
    }
760545
public static function setNamespaces($namespaces)
    {
        $called = get_called_class();

        if (!$namespaces instanceof PriorityQueue) {
            $namespaces = new PriorityQueue();
        }

        static::$namespaces[$called] = $namespaces;
    }
1233680
private function parse($args)
    {
        foreach ($args as $argument) {
            $this->arguments->push($argument);
            if ($this->detectFlags($argument)) {
                continue;
            }
            if ($this->detectOptions($argument)) {
                continue;
            }
            if ($this->detectConcatFlag($argument)) {
                continue;
            }
            $this->commands->push($argument);
        }
    }
968045
public function init($args)
    {
        if (empty($args) || OL_ZEUS_ISADMIN) {
            return;
        }

        // Special case
        if (is_bool($args) && $args) {
            $args = $this->available;
        }

        // Iterate on all
        foreach ($args as $key) {
            $key = strtolower($key);

            if (!in_array($key, $this->available)) {
                continue;
            }

            if (in_array($key, ['index_rel_link', 'parent_post_rel_link', 'rest_output_link_wp_head', 'rsd_link', 'start_post_rel_link', 'wp_dlmp_l10n_style', 'wp_resource_hints', 'wlwmanifest_link'])) {
                $this->headerWpHead($key);
                continue;
            }

            $key = str_replace('_', '-', $key);

            $function = Helpers::toFunctionFormat($key);
            $function = 'header'.ucfirst($function);
            $this->$function();
        }
    }
858969
protected function injectVariables(array $args)
    {
        if (empty($args)) {
            return;
        }

        $parser = $this->parserFactory(__METHOD__);

        foreach ($args as $name => $strValue) {
            if ($name[0] === '$') {
                $name = substr($name, 1);
            }

            if (! $parser->parseValue($strValue, $value)) {
                $value = $this->coerceValue($strValue);
            }

            $this->set($name, $value);
        }
    }
918534
private function addArg(array $schema, Args $args, $arg) {
        $argsCount = count($args->getArgs());
        $schemaArgs = isset($schema[self::META][self::ARGS]) ? array_keys($schema[self::META][self::ARGS]) : [];
        $name = isset($schemaArgs[$argsCount]) ? $schemaArgs[$argsCount] : $argsCount;

        $args->addArg($arg, $name);
    }
45076
public function handleAdd(Args $args)
    {
        $flags = $args->isOptionSet('force')
            ? DiscoveryManager::OVERRIDE | DiscoveryManager::IGNORE_TYPE_NOT_FOUND
                | DiscoveryManager::IGNORE_TYPE_NOT_ENABLED
            : 0;

        $bindingParams = array();
        $artifact = $args->getArgument('artifact');

        $this->parseParams($args, $bindingParams);

        if (false !== strpos($artifact, '\\') || $args->isOptionSet('class')) {
            $binding = new ClassBinding(
                $artifact,
                $args->getArgument('type'),
                $bindingParams
            );
        } else {
            $binding = new ResourceBinding(
                Path::makeAbsolute($artifact, $this->currentPath),
                $args->getArgument('type'),
                $bindingParams,
                $args->getOption('language')
            );
        }

        $this->discoveryManager->addRootBindingDescriptor(new BindingDescriptor($binding), $flags);

        return 0;
    }
809622
public function withArgs($args = [])
    {
        if (!is_array($args)) {
            $args = func_get_args();
        }

        $this->args = $args;
        return $this;
    }
210895
private static function formatArgsForExpression(array $args)
    {
        $mapping = [];
        foreach ($args as $name => $config) {
            $mapping[] = \sprintf('%s: "%s"', $name, $config['type']);
        }

        return \sprintf('arguments({%s}, args)', \implode(', ', $mapping));
    }
1369813
public function add_component( array $args )
    {
        if(!array_key_exists('type', $args))
        {
            throw new \RuntimeException("Component configuration arrays must have a <b>type</b> argument");
        }

        $comp = ComponentFactory::create($args['type'], $args);

        $this->verify_name_uniqueness($comp);
        $this->components[] = $comp;
    }
1223632
public function setNamespaceAliases(array $namespace_aliases)
    {
        $this->namespace_aliases = array();
        foreach ($namespace_aliases as $alias => $fqnn) {
            $this->setNamespaceAlias($alias, $fqnn);
        }
        return $this;
    }
1244854
public function init($args)
    {
        if (empty($args)) {
            return;
        }

        // Special case
        if (is_bool($args) && $args) {
            $args = $this->available;
        }

        // Iterate on all
        foreach ($args as $plugin => $settings) {
            $plugin = strtolower($plugin);

            if (!array_key_exists($plugin, $this->available)) {
                continue;
            }

            $plugin = str_replace('_', '-', $plugin);

            $function = Helpers::toFunctionFormat($plugin);
            $function = 'plugin'.ucfirst($function);
            $this->$function($settings);
        }
    }
1276177
public static function add_namespaces(array $namespaces, $prepend = false)
	{
		if ( ! $prepend)
		{
			static::$namespaces = array_merge(static::$namespaces, $namespaces);
		}
		else
		{
			static::$namespaces = $namespaces + static::$namespaces;
		}
	}
134687
public function add($alias, array $namespace)
    {
        $alias = Input::checkAlias($alias);
        $props = $this->getNamespace($alias, true);

        foreach ($namespace as $ns) {
            $group = $this->getNamespaceGroup($ns);

            if ('any' === $group) {
                $props = ['any' => true];
                break;
            } else {
                // trim trailing * from path pattern
                $ns = 'path' === $group ? rtrim($ns, '*') : $ns;
                $props[$group][] = $ns;
            }
        }

        $this->setNamespace($alias, $props);
    }
86605
private function fill(array $args)
    {
        $properties = array_keys(get_object_vars($this));
        foreach ($args as $key => $value) {
            if (in_array($key, $properties)) {
                $this->{$key} = $value;
            }
        }
    }
347055
protected function initService(array $args = null) {
		$reflection = $this->getReflection();
		
		if ($args === null) {
			return $reflection->newInstance();
		}
		
		return $reflection->newInstanceArgs($args);
	}
199076
public function addEnvironmentReader(array $arguments = [])
    {
        // Full namespace: <EXTENSION_NAMESPACE>\Environment\<EXTENSION_CONFIG_KEY>EnvironmentReader.
        // For example we have registered extension at namespace: "Behat\TqExtension". Class, which
        // implements extension interface, located at "Behat\TqExtension\ServiceContainer\TqExtension"
        // and its method, "getConfigKey()", returns the "tq" string. In this case the full namespace
        // of the reader object will be: "Behat\TqExtension\Environment\TqEnvironmentReader" and its
        // constructor will have a set of arguments that were passed to this method.
        $this->addDefinition(
            'Environment',
            'Reader',
            EnvironmentExtensionReader::class,
            EnvironmentExtension::READER_TAG,
            array_merge([$this->namespace, $this->path], $arguments)
        );
    }