@param string|array|DefinitionSource ...$definitions

@return ContainerConfiguration
491762
public function configure(...$definitions): ContainerConfiguration
    {
        $builder = new ContainerBuilder(ContainerConfiguration::class);

        $builder->useAutowiring(false)->useAnnotations(false)->ignorePhpDocErrors(false);

        $wiring = $this->config[WIRING] ?? null;
        if (fn\hasValue($wiring, [WIRING\REFLECTION, WIRING\AUTO])) {
            $builder->useAutowiring(true);
        } else if ($wiring === WIRING\STRICT) {
            $builder->useAnnotations(true)->ignorePhpDocErrors(false);
        } else if ($wiring === WIRING\TOLERANT) {
            $builder->useAnnotations(true)->ignorePhpDocErrors(true);
        }

        empty($this->config[CACHE]) || $builder->enableDefinitionCache();
        empty($this->config[PROXY]) || $builder->writeProxiesToFile(true, $this->config[PROXY]);
        empty($this->config[COMPILE]) || $builder->enableCompilation($this->config[COMPILE]);
        $this->container && $builder->wrapContainer($this->container);

        foreach ($definitions as $definition) {
            $builder->addDefinitions($definition);
        }

        /** @noinspection PhpUnhandledExceptionInspection */
        /** @noinspection PhpIncompatibleReturnTypeInspection */
        $built = $builder->build();
        return $built instanceof ContainerConfiguration
            ? $built
            : new ContainerConfiguration($built);
    }
753848
protected function mergeDefinitions(array $definitions)
    {
        return array_merge(
            $definitions,
            array(
                new InputOption('config', 'c', InputOption::VALUE_OPTIONAL, 'Path to config file. Inline options override.', Resque::DEFAULT_CONFIG_FILE),
                new InputOption('include', 'I', InputOption::VALUE_OPTIONAL, 'Path to include php file'),
                new InputOption('host', 'H', InputOption::VALUE_OPTIONAL, 'The Redis hostname.', Resque\Redis::DEFAULT_HOST),
                new InputOption('port', 'p', InputOption::VALUE_OPTIONAL, 'The Redis port.', Resque\Redis::DEFAULT_PORT),
                new InputOption('scheme', null, InputOption::VALUE_REQUIRED, 'The Redis scheme to use.', Resque\Redis::DEFAULT_SCHEME),
                new InputOption('namespace', null, InputOption::VALUE_REQUIRED, 'The Redis namespace to use. This is prefixed to all keys.', Resque\Redis::DEFAULT_NS),
                new InputOption('password', null, InputOption::VALUE_OPTIONAL, 'The Redis AUTH password.'),
                new InputOption('log', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Specify the handler(s) to use for logging.'),
                new InputOption('events', 'e', InputOption::VALUE_NONE, 'Outputs all events to the console, for debugging.'),
            )
        );
    }
192646
private function getDictionaryBuilder(DictionaryDefinition $definition): DictionaryBuilderInterface
    {
        if (!$this->dictionaryBuilders->has($typeName = $definition->getType())) {
            $typeName = 'default';
        }

        return $this->dictionaryBuilders->get($typeName);
    }
1361271
public function buildContainer(
        ExtensionInterface $extension = null,
        array $config = [],
        array $parameters = [],
        array $compilerPasses = []
    ) {
        $container = new ContainerBuilder();
        if ($extension !== null) {
            $extension->setConfigDirectories($this->configDirectories);
            $extension->buildContainer($container, $config);
        }
        foreach ($parameters as $key => $value) {
            $container->setParameter($key, $value);
        }
        foreach ($compilerPasses as $compilerPass) {
            $container->addCompilerPass($compilerPass);
        }
        $container->compile();

        return $container;
    }
235037
public function setDefinitions($definitions)
    {
        if (\is_string($definitions)) {
            $definitions = [$definitions];
        }

        if ($definitions instanceof \Traversable) {
            $definitions = \iterator_to_array($definitions);
        }

        if (!\is_array($definitions)) {
            throw new \InvalidArgumentException(
                \sprintf('Definitions must be a string or traversable. %s given', \gettype($definitions))
            );
        }

        \array_walk(
            $definitions,
            function ($definition) {
                if (!\is_array($definition) && !\is_string($definition)) {
                    throw new \InvalidArgumentException(
                        \sprintf(
                            'A definition must be an array or a file or directory path. %s given',
                            \gettype($definition)
                        )
                    );
                }
            }
        );

        $this->definitions = $definitions;

        return $this;
    }
1203276
public static function run($definition) {
		$filterCollection = ScenarioHelper::forgeCollection($definition['filters']);
		$config = ScenarioHelper::runAll($filterCollection, []);
		$definition['commands'] = Helper::assignAttributesForList($definition['commands'], [
			'env' => $config,
		]);
		$commandCollection = ScenarioHelper::forgeCollection($definition['commands']);
		ScenarioHelper::runAll($commandCollection);
		return $config;
	}
854805
public function parseRulesDefinition($definition): RulesCollection
    {
        if (is_callable($definition)) {

            $definition = [$definition];

        }

        if (is_string($definition)) {

            $definition = array_map('trim', explode('|', $definition));

        }

        if (is_array($definition)) {

            $keys = array_keys($definition);

            return array_reduce($keys, function ($rules, $key) use ($definition) {

                $definition = $definition[$key];

                $rule = $this->parseRuleDefinition($key, $definition);

                return $rules->withRule($rule);

            }, new RulesCollection);

        }

        throw new InvalidRuleFormatException($definition);
    }
73738
public function load(array $definitions)
    {
        $this->data = $definitions['data'] ?? [];
        $this->parentAliases = $definitions['parent_aliases'] ?? [];
        foreach ($this->data as $value) {
            $this->validateDefinitions($value);
        }
    }
721138
public function addDefinitions(array $definitions)
    {
        foreach ($definitions as $name => $definition) {
            if (!($definition instanceof DefinitionInterface)) {
                throw new DcGeneralInvalidArgumentException(
                    'Definition ' . $name . ' does not implement DefinitionInterface.'
                );
            }

            $this->setDefinition($name, $definition);
        }

        return $this;
    }
184780
public function setData($definitions)
    {
        if (is_array($definitions)) {
            $this->parsedData = $definitions;
            return;
        }

        if (!is_file($definitions)) {
            throw new InvalidArgumentException(
                "The form definition file '{$definitions}' does not exists."
            );
        }

        try {
            $this->parsedData = Yaml::parse(file_get_contents($definitions));
        } catch (\Exception $caught) {
            throw new ParserErrorException(
                'Error parsing form definitions: '.$caught->getMessage(),
                0,
                $caught
            );
        }
    }
9484
static protected function createResources($definitions) {
		$resources = [];
		
		foreach ($definitions as $name => $options) {
			if (! isset($options['type'])) {
				throw new InvalidOptions('Type of resource must be specified');
			}
			
			$class = self::NAMESPACE_RESOURCE . '\\' . ucfirst($options['type']);
			unset($options['type']);
			
			$resources[$name] = new $class($options);
		}
		
		return $resources;
	}
1053634
public function arrayToClassElement($definition)
    {
        $class = new Classes();
        if (isset($definition['docblock'])) {
            $docblock = $this->arrayToDocblockElement($definition['docblock']);
            $class->setDocbloc($docblock);
        }
        if (isset($definition['namespace'])) {
            $class->setNamespace($definition['namespace']);
        }
        if (isset($definition['name'])) {
            $class->setName($definition['name']);
        }
        if (isset($definition['extends'])) {
           $class->setExtends($definition['extends']);
        }
        if (isset($definition['implements'])) {
            foreach ($definition['implements'] as $interface) {
                $class->addImplements($interface);
            }
        }
        if (isset($definition['uses'])) {
            foreach ($definition['uses'] as $alias => $use) {
                $alias = is_string($alias) ? $alias : null;
                $class->addUse($use, $alias);
            }
        }
        if (isset($definition['functions'])) {
            foreach ($definition['functions'] as $definition) {
                $function = $this->arrayToFunctionElement($definition);
                $class->addFunction($function);
            }
        }
        return $class;
    }
882451
public function newInputFilter(array $definition = array())
    {
        if (!empty($definition)) {
            $this->_definition = $definition;
        }
        $this->_inputFilter = new InputFilter();

        foreach ($this->_definition as $key => $item) {
            if (!is_string($key)) {
                $key = $item['name'];
            }
            $this->_addInput($item, $key);
        }

        return $this->_inputFilter;
    }
1286242
public function compile($definition)
    {
        $validator = $this->createValidator($definition);
        $validator->validate($definition);

        return new ScalarValidator($definition->export());
    }
1271447
public function container(string $containerClass = Container::class): ContainerInterface
    {
        if (($source = $this->getDefinitionSource()) instanceof MutableDefinitionSource) {
            return new $containerClass($source, $this->getProxyFactory(), $this->getWrapperContainer());
        }
        return $source;
    }
369957
public function bindPrototype(string $name, $definition)
    {
        $this->definitions[$name] = new Prototype($name, $definition);
        return $this;
    }
1093803
public function createDictionary(DictionaryDefinition $definition): DictionaryInterface
    {
        $builder = $this->getDictionaryBuilder($definition);

        /** @var DictionaryBuilderInterface $builder */
        return $builder->build($this, $definition);
    }