Build a job.

@param Configuration $configuration The configuration to populate.
@param array         $data          The configuration values to use.

@return Definition

@throws \RuntimeException When the job type is not registered.
161585
public function buildJob(Configuration $configuration, array $data): Definition
    {
        try {
            $builder = $this->jobBuilders->get($data['type']);
        } catch (ServiceNotFoundException $exception) {
            throw new \RuntimeException('Unknown job type "' . $data['type'] . '"', 0, $exception);
        }
        /** @var DefinitionBuilderInterface $builder */
        return $builder->build($configuration, $data);
    }
800386
public function collectDataForType(IndexConfiguration $configuration)
    {
        $event = new IndexEvent(
            $configuration->getType(),
            $configuration->getCode(),
            $configuration->getTitle(),
            $configuration->getMapping()
        );

        $this->indexEngineDispatcher->dispatch(IndexEngineEvents::COLLECT_DATA_TO_INDEX, $event);

        return $event->getIndexDataVector();
    }
1315736
private function bind(array $configurations)
    {
        $configuratorFactory = clone $this->configuratorFactory;

        if (isset($configurations['crud'])) {
            /** @var CrudConfigurator $crudConfigurator */
            $crudConfigurator = $configuratorFactory->getConfigurator(CrudConfigurator::class);
            $crudConfigurator->setCrud($configurations['crud']);
            $configuratorFactory->addConfigurator($crudConfigurator);
        }

        if (isset($configurations['driver'])) {
            /** @var DriverConfigurator $driverConfigurator */
            $driverConfigurator = $configuratorFactory->getConfigurator(DriverConfigurator::class);
            $driverConfigurator->setDriver($configurations['driver']);
            $configuratorFactory->addConfigurator($driverConfigurator);
        }

        if (isset($configurations['grid'])) {
            /** @var GridConfigurator $gridConfigurator */
            $gridConfigurator = $configuratorFactory->getConfigurator(GridConfigurator::class);
            $gridConfigurator->setGrid($configurations['grid']);
            $configuratorFactory->addConfigurator($gridConfigurator);
        }

        if (isset($configurations['page'])) {
            /** @var PageConfigurator $pageConfigurator */
            $pageConfigurator = $configuratorFactory->getConfigurator(PageConfigurator::class);
            $pageConfigurator->setPage($configurations['page']);
            $configuratorFactory->addConfigurator($pageConfigurator);
        }

        if (isset($configurations['plugin'])) {
            /** @var PluginConfigurator $pluginConfigurator */
            $pluginConfigurator = $configuratorFactory->getConfigurator(PluginConfigurator::class);
            $pluginConfigurator->setPlugin($configurations['plugin']);
            $configuratorFactory->addConfigurator($pluginConfigurator);
        }

        if (isset($configurations['security'])) {
            /** @var SecurityConfigurator $securityConfigurator */
            $securityConfigurator = $configuratorFactory->getConfigurator(SecurityConfigurator::class);
            $securityConfigurator->setSecurity($configurations['security']);
            $configuratorFactory->addConfigurator($securityConfigurator);
        }

        if (isset($configurations['util'])) {
            /** @var UtilConfigurator $utilConfigurator */
            $utilConfigurator = $configuratorFactory->getConfigurator(UtilConfigurator::class);
            $utilConfigurator->setUtil($configurations['util']);
            $configuratorFactory->addConfigurator($utilConfigurator);
        }

        return $configuratorFactory;
    }
687695
public function build(array $configuration, $presetName)
    {
        $formDefaults = $this->getPresetConfiguration($presetName);

        $form = isset($configuration['type']) ?
            new FormDefinition($configuration['identifier'], $formDefaults, $configuration['type']) :
            new FormDefinition($configuration['identifier'], $formDefaults);

        if (isset($configuration['renderables'])) {
            foreach ($configuration['renderables'] as $pageConfiguration) {
                $this->addNestedRenderable($pageConfiguration, $form);
            }
        }

        unset($configuration['renderables']);
        unset($configuration['type']);
        unset($configuration['identifier']);
        unset($configuration['label']);
        $form->setOptions($configuration);

        $this->triggerFormBuildingFinished($form);

        return $form;
    }
515198
public static function build(Configuration $configuration = null): DIContainer
    {
        if ($configuration === null) {
            $configuration = new Configuration();
        }

        $defaultDefinitions = \array_merge(
            require __DIR__ . '/definitions.php',
            [Configuration::class => $configuration]
        );
        $customDefinitions = self::parseDefinitions($configuration->getDefinitions());

        return self::getContainerBuilder($configuration)
            ->addDefinitions($defaultDefinitions, ...$customDefinitions)
            ->build();
    }
1054128
public function generate($configuration)
    {
        $generator = new Generator(
            $this->setting->getPackageDirectory(),
            $configuration
        );

        if ($generator->fileExists()) {
            echo Color::red('The configuration already exists.');

            exit(0);
        }

        $generator->write('configuration', [
            'baseNamespace' => $this->namespaces['configuration']
        ]);

        echo Color::green('The configuration was well created.');

        exit(0);
    }
919097
public static function buildConfig(Event $event)
    {
        if (true === $event->isDevMode()) {
            $app = new AppKernel('dev', true);
            $app->boot();
            $container = $app->getContainer();
            /**
             * @var ConfigurationProcessorHandler
             */
            $processor = $container->get('bruli.command.bus');

            $processor->handle(new ConfigurationProcessor($event->getIO()));
        }
    }
220195
protected function executeApi(Configuration $config)
    {
        $client = new Client();
        $api = new Jobs($config, $client);
        $repository = new JobsRepository($api, $config);

        $repository->setLogger($this->logger);

        return $repository->persist();
    }
54057
static public function getInstance( $configuration = array() )
    {
        if (empty( self::$instance )) {
            self::$instance = new Config( $configuration );
        }
        return self::$instance;
    }
1181132
public function build(Configuration $configuration, array $data): Definition
    {
        $name = $data['name'];
        unset($data['name']);
        $data['type'] = 'contao';

        return new DictionaryDefinition($name, $data);
    }
159747
public function create(Configuration $configuration, OutputInterface $output)
    {
        $this->symbolTable = new SymbolTable();

        $deprecationProgressOutput = new VerboseProgressOutput(
            new ProgressBar($output),
            $configuration->isVerbose(),
            'Deprecation detection'
        );
        $deprecationUsageParser = $this->getUsageParser($configuration);
        $deprecationUsageFinder = new ParsedPhpFileFinder(
            $deprecationUsageParser,
            $deprecationProgressOutput,
            new UsageFinderFactory()
        );

        $this->ancestorResolver = new AncestorResolver($deprecationUsageParser);

        $ruleSetProgressOutput = new VerboseProgressOutput(
            new ProgressBar($output),
            $configuration->isVerbose(),
            'RuleSet generation'
        );
        $ruleSetDeprecationParser = $this->getDeprecationParser();
        $ruleSetDeprecationFinder = new ParsedPhpFileFinder(
            $ruleSetDeprecationParser,
            $ruleSetProgressOutput,
            new DeprecationFinderFactory()
        );
        $deprecationDirectoryTraverser = new DirectoryTraverser($ruleSetDeprecationFinder);

        $violationDetector = $this->getViolationDetector($configuration);

        $renderer = $this->getRenderer($configuration, $output);

        $ruleSetLoader = $this->getRuleSetLoader($deprecationDirectoryTraverser, $configuration);

        $progressOutput = new DefaultProgressOutput($output, new Stopwatch());

        return new DeprecationDetector(
            $this->getPredefinedRuleSet(),
            $ruleSetLoader,
            $this->ancestorResolver,
            $deprecationUsageFinder,
            $violationDetector,
            $renderer,
            $progressOutput
        );
    }
1153655
private function compile(Configuration $configuration)
    {
        $container = $this->loader->loadContainer($configuration);

        foreach ($configuration->getCompilerPasses() as $compilerPass) {
            $container->addCompilerPass($compilerPass);
        }

        $container->compile();

        return $container;
    }
957343
public function configure(array $config, ConfigurationInterface $configuration, ContainerBuilder $container)
    {
        $processor = new Processor();
        $config    = $processor->processConfiguration($configuration, $config);

        $loader = new XmlFileLoader($container, new FileLocator($this->getConfigurationDirectory()));

		foreach(WallPosterBundle::getAvailableProviders() as $service)
		{
			if(isset($config[$service]))
			{
				$this->mapParameters($service, $config[$service], $container);
				$this->loadConfigurationFile($service,$loader);
			}
		}

        return array($config, $loader);
    }
667996
public function bootstrap( $config = [], $run = true ) {
		$this->renderConfigurationExceptions( function () use ( $config, $run ) {
			if ( $this->isBootstrapped() ) {
				throw new ConfigurationException( static::class . ' already bootstrapped.' );
			}

			$container = $this->getContainer();
			$this->loadConfig( $container, $config );
			$this->loadServiceProviders( $container );
			$this->loadRoutes(
				Arr::get( $config, 'routes.web', '' ),
				Arr::get( $config, 'routes.admin', '' ),
				Arr::get( $config, 'routes.ajax', '' )
			);

			$this->bootstrapped = true;

			if ( $run ) {
				$kernel = $this->resolve( WPEMERGE_WORDPRESS_HTTP_KERNEL_KEY );
				$kernel->bootstrap();
			}
		} );
	}
1168479
protected function configureHydrator(array $config, ContainerBuilder $container)
    {
        if (!$container->hasDefinition($config['hydrator'])) {
            throw new \RuntimeException(sprintf('Unable to load hydrator service "%s"', $config['hydrator']));
        }

        $container->getDefinition('eko_feed.feed.reader')
            ->addMethodCall('setHydrator', [new Reference($config['hydrator'])]);
    }
183961
public function build($service = null)
    {
        if (!$this->sender) {
            $this->sender = $this->buildGuzzleSender();
        }

        if (!$this->factory) {
            throw new RuntimeException("You need to provide a configuration or a factory for requests");
        }

        if (!$this->logger) {
            $this->logger = new NullLogger();
        }

        return $this->buildClient($this->factory, $this->sender, $this->logger, $service);
    }
457479
private function setImporters(Configuration $configuration, array $data)
    {
        foreach ($this->listImporters as $importer) {
            $importer->setRootPath($configuration->getExtractPath());
            if ($owner = $configuration->getOwner()) {
                $importer->setOwner($owner);
            } else {
                $importer->setOwner($this->container->get('security.token_storage')->getToken()->getUser());
            }
            $importer->setConfiguration($data);
            $importer->setListImporters($this->listImporters);

            if ($this->logger) $importer->setLogger($this->logger);
        }
    }