Creates a new IssueTracker (IssueTracker object) with the given configuration.

@param string $name
@param array  $adapterConfig
@param Config $globalConfig

@throws \InvalidArgumentException
@throws \LogicException

@return IssueTracker
776510
public function createIssueTracker($name, array $adapterConfig, Config $globalConfig)
    {
        $factory = $this->getFactoryObject($name);

        if (!$factory instanceof IssueTrackerFactory) {
            throw new \LogicException(sprintf('Adapter %s does not support issue-tracking.', $name));
        }

        return $factory->createIssueTracker($adapterConfig, $globalConfig);
    }
640078
public static function registerConfig($name, array $config) {
		if( empty($config['path']) ) {
			throw new \Exception('Missing a valid "path" in configuration of route "'.$name.'"');
		}
		
// 		$parameters = array();
// 		if( isset($config['parameters']) && is_array($config['parameters']) ) {
// 			foreach( $config['parameters'] as $paramName => $paramConfig ) {
// 				$parameters[] = CLIArgument::make($paramName, $paramConfig);
// 			}
// 		}
		$options = $config;
		unset($options['path'], $options['controller'], $options['parameters']);
		static::register($name, $config['path'], $config['controller'], array(), $options);
	}
562804
public function connect(array $config, string $name = 'main'): Connection
    {
        if (isset($this->connections[$name])) {
            throw new InvalidArgumentException("Connection [$name] is already configured.");
        }

        $this->connections[$name] = new Connection($config);

        return $this->connections[$name];
    }
881412
public function helper($name, array $config = []) {
		if (isset($this->_helpers[$name])) {
			return $this->_helpers[$name];
		}
		try {
			$config += ['context' => $this];
			return $this->_helpers[$name] = Libraries::instance('helper', ucfirst($name), $config);
		} catch (ClassNotFoundException $e) {
			if (ob_get_length()) {
				ob_end_clean();
			}
			throw new RuntimeException("Helper `{$name}` not found.");
		}
	}
1242096
public static function initPdoDatabase($config, $name)
    {
        try {
            $pdo = static::createPdoConnectionByConfig($config);
        } catch (PDOException $e) {
            throw new Exception('Cannon instantiate database connection: ' . $e->getMessage());
        }

        $pdo->uniqueName = $config['host'] . "-" . $config['db'];

        static::checkDebugBar($pdo, $name);

        return new RepositoryPDO($pdo, $name);
    }
945446
protected function resolve($name): EmailVerificationBrokerContract
    {
        $config = $this->getConfig($name);

        if (is_null($config)) {
            throw new InvalidArgumentException("Email verification broker [{$name}] is not defined.");
        }

        return new EmailVerificationBroker(
            $this->app['auth']->createUserProvider($config['provider']),
            $this->app['config']['app.key'],
            $config['expire']
        );
    }
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];
    }
623596
public function set(string $name, string $config): self
    {
        try {
            $this->sections[$name] = new SectionConfiguration($config);
        } catch (\Throwable $e) {
            throw new \InvalidArgumentException(
                sprintf('AppSection "%s" configuration is invalid: %s', $name, $e->getMessage()), 0, $e
            );
        }

        return $this;
    }
1133936
public static function config($name = null, $config = null, $override = false)
    {
        $overrideAll = (is_array($name) && is_bool($config)) ? $config : false;

        return Util::operateArray(self::$agentsConfig, $name, $config, [], function ($name, array $config) use ($override) {
            self::modifyConfig($name, $config, $override);
        }, $overrideAll, function (array $origin) {
            foreach (array_keys($origin) as $name) {
                if (self::hasAgent("$name")) {
                    self::getAgent("$name")->config([], true);
                }
            }
        });
    }
188873
function addLogger (state, name, config, adapter) {
  config = Object.assign({}, defaultConfig, config)
  setFilters(config)
  const logger = {
    name: name,
    config: config,
    adapter: adapter,
    addFilter: addFilter.bind(null, config),
    removeFilter: removeFilter.bind(null, config),
    setFilter: setFilter.bind(null, config),
    setFilters: setFilters.bind(null, config)
  }
  if (config.namespaceInit) {
    logger.init = memoize(adapter)
  }
  logger.log = onEntry.bind(null, logger)
  state.loggers[ name ] = logger
}
430696
public static function create($name, array $config = array())
    {
        if (!isset(self::$config->generators[$name])) {
            throw new Exception("Unknown generator '$name'.");
        }

        $generator = \Yii::createComponent(\CMap::mergeArray(self::$config->generators[$name], $config));
        $generator->init();

        foreach (self::$config->attributes as $attribute => $value) {
            if (property_exists($generator, $attribute)) {
                $generator->$attribute = $value;
            }
        }

        return $generator;
    }
723192
public static function adapter($name = null) {
		if (!$name) {
			if (!$names = array_keys(static::$_configurations)) {
				return;
			}
			$name = end($names);
		}
		return parent::adapter($name);
	}
375472
protected function getProxyInstance(string $name, ReflectionClass $class, array $arguments, array $config)
    {
        $factory = new LazyLoadingValueHolderFactory();
        $that = $this;

        return $factory->createProxy(
            $class->getName(),
            function (&$wrappedObject, $proxy, $method, $parameters, &$initializer) use ($that, $name,$class,$arguments,$config) {
                $wrappedObject = $that->getRealInstance($name, $class, $arguments, $config);
                $initializer = null;
            }
        );
    }
1310021
public function getParam($name) {
        if (empty($name) || !is_string($name)) {
            throw new \InvalidArgumentException('Paramater name must be not empty string');
        }

        if (isset($this->params[$name]) || array_key_exists($name, $this->params)) {
            return $this->params[$name];
        }
        throw new ConfigurationException(sprintf('Parameter %s doesn\'t exists', $name));
    }
1038462
public function getAdapter(string $name): ShellAdapterInterface
    {
        if (!array_key_exists($name, $this->shellAdapters)) {
            throw new Exception\DomainException("Shell adapter \"$name\" not found.");
        }

        return clone $this->shellAdapters[$name];
    }
1119523
public function setConfig($name, array $config)
    {
        if (isset($this->configs[$name])) {
            throw new \InvalidArgumentException(sprintf(
                '%s config "%s" already exists.',
                $this->serviceType,
                $name
            ));
        }

        $this->configs[$name] = $config;
    }
1363648
public function getAdapter($name)
    {
        if (!isset($this->adapters[$name])) {
            throw new Exception\ConnectionException(
                "Adapter " . $name . " not registered on connection!"
            );
        }

        return $this->adapters[$name];
    }