@param array $configure

@return PackerInterface|null
967639
protected function detectPacker(array $configure): ?PackerInterface
    {
        if (!is_null($configure['packer'])) {
            if (class_exists($configure['packer'])) {
                return $this->app->make($configure['packer']);
            }
        }
        return null;
    }
345306
public function make(array $config): Client
    {
        $config = $this->getConfig($config);

        return $this->getClient($config);
    }
1171866
public function configure(array $config = [])
    {
        if (isset($config['email'])) {
            if (! is_array($config['email'])) {
                throw new InvalidArgumentException('Email configuration should be an array.');
            }
            $this->emailConfig = $config['email'];
        }

        // Check if config has defined a tempDir
        if (isset($config['tempDir']) && is_dir($config['tempDir'])) {
            $this->tempDir = $config['tempDir'];
        }

        return $this;
    }
116329
public function getConfiguration($filename) {

        $cacheManager = new CacheManager();
        $configuration = $cacheManager->retrieveFromCache('/' . $filename);
        if (!is_array($configuration)) {
            return null;
        }
        $config = new Config($configuration);
        $cacheManager = null;

        return $config;
    }
807047
public function downloader(VersionControlProvider $vcs): ?VCSDownloaderInterface
    {
        $adapter = $this->adapters[$vcs->type()] ?? null;
        if (!$adapter) {
            $this->addError(self::ERR_VCS_MISCONFIGURED);
            return null;
        }

        $downloader = $adapter->buildDownloader($vcs);

        if ($downloader instanceof VCSDownloaderInterface) {
            return $downloader;
        }

        $this->importErrors($adapter->errors());
        return null;
    }
1059315
public function get($key, $default = null, $package = null)
    {
        if ($package) {
            return $this->getForPackage($package, $key, $default);
        }
        return Arr::get($this->mainConfiguration, $key, $default);

    }
73837
public static function create($conf = null)
    {
        self::$defaultConf = new FakerinoConf();
        self::$defaultConf->loadConfiguration();
        if ($conf !== null) {
            $confArray = $conf;
            if (!is_array($conf)) {
                $confTypeFactory = new FileConfigurationLoaderFactory(
                    $conf
                );
                $confParser = $confTypeFactory->load();
                $confArray = $confParser->toArray();
            }
            $conf = $confArray;
        }
        self::$defaultConf = new FakerinoConf($conf);
        self::$defaultConf->loadConfiguration();

        return new FakeDataFactory(self::getDefaultHandler(), new DoctrineLayer(self::getDatabaseConfig()), new TwigTemplate());
    }
151050
public static function configure(array $config)
    {
        static::$config = $config;

        if (is_null(static::$mounted)) {
            static::$mounted = static::mount($config['disk']['mount']);
        }

        return static::$mounted;
    }
1060358
protected function run(Config $config): ResultInterface
    {
        $packages = WP_CLI::runcommand(
            'package list --fields=name,version,update_version --format=json',
            [
                'return' => true,
                'parse' => 'json',
                'launch' => true,
                'exit_error' => false,
            ]
        );

        $outdatedPackages = array_filter($packages, function (array $package): bool {
            return ! empty($package['update_version']);
        });

        $excludes = $config->compileExcludes([]);
        $outdatedPackages = array_filter($outdatedPackages, function (array $package) use ($excludes): bool {
            $isNotExcluded = ! in_array($package['name'], $excludes, true);

            // To exclude dev-master.
            $isNotDev = $package['update_version'] !== $package['version'];

            return $isNotExcluded && $isNotDev;
        });

        $messages = array_map(function (array $package): string {
            return "${package['name']} (${package['version']} => ${package['update_version']})";
        }, $outdatedPackages);

        return (empty($messages))
            ? ResultFactory::makeSuccess($this)
            : ResultFactory::makeFailure(
                $this,
                array_merge(['WP CLI package updates available:'], $messages)
            );
    }
236113
protected function getLayout(View $viewConfiguration)
    {
        $layout = $this->arguments['layout'];

        if (false === is_string($layout)) {
            throw InvalidArgumentTypeException::invalidTypeNameArgumentFieldViewHelper($layout);
        }

        list($layoutName, $templateName) = GeneralUtility::trimExplode('.', $layout);

        if (empty($templateName)) {
            $templateName = 'default';
        }

        if (empty($layoutName)) {
            throw InvalidArgumentValueException::fieldViewHelperEmptyLayout();
        }

        if (false === $viewConfiguration->hasLayout($layoutName)) {
            throw EntryNotFoundException::fieldViewHelperLayoutNotFound($layout);
        }

        if (false === $viewConfiguration->getLayout($layoutName)->hasItem($templateName)) {
            throw EntryNotFoundException::fieldViewHelperLayoutItemNotFound($layout, $templateName);
        }

        return $viewConfiguration->getLayout($layoutName)->getItem($templateName);
    }
372970
public function toFigure($todo = null) {
		$this->toWords = false;

		if ($todo !== null)
			$this->todo = $todo;

		if ($this->todo !== null)
			return $this->doQuadrillion();
	}
1208451
public function make(array $config): SearchClient
    {
        $config = $this->getConfig($config);

        return $this->getClient($config);
    }
98779
protected function decorateWithCachedAdapter(AdapterInterface $adapter, array $config)
    {
        if (
            ($cacheDriver = Arr::get($config, 'driver', false)) !== false &&
            (is_a($cacheDriver, 'League\Flysystem\Cached\CacheInterface') ||
                class_exists($driverName = Arr::get($this->cacheDrivers, $cacheDriver, $cacheDriver))
            )
        ) {
            if (isset($driverName)) {
                switch ($driverName) {
                    case 'League\Flysystem\Cached\Storage\Adapter':
                        $cacheDriver = new \League\Flysystem\Cached\Storage\Adapter($this->disk(Arr::get($config, 'disk', 'local'))->getAdapter(), Arr::get($config, 'file', 'flysystem.cache'), Arr::get($config, 'expire', null));
                        break;
                    case 'Madewithlove\IlluminatePsrCacheBridge\Laravel\CacheItemPool':
                        $cacheDriver = new \League\Flysystem\Cached\Storage\Psr6Cache(new \Madewithlove\IlluminatePsrCacheBridge\Laravel\CacheItemPool($this->app->make(\Illuminate\Contracts\Cache\Repository::class)), Arr::get($config, 'key', 'flysystem'), Arr::get($config, 'expire', null));
                        break;
                    case 'League\Flysystem\Cached\Storage\Memcached':
                        if (class_exists('Memcached')) {
                            $memcached = new \Memcached;
                            $memcached->addServer(Arr::get($config, 'host', 'localhost'), Arr::get($config, 'port', 11211));

                            $cacheDriver = new \League\Flysystem\Cached\Storage\Memcached($memcached, Arr::get($config, 'key', 'flysystem'), Arr::get($config, 'expire', null));
                        } else {
                            return $adapter;
                        }
                        break;
                    case 'League\Flysystem\Cached\Storage\Memory':
                        $cacheDriver = new \League\Flysystem\Cached\Storage\Memory;
                        break;
                    case 'League\Flysystem\Cached\Storage\Noop':
                        $cacheDriver = new \League\Flysystem\Cached\Storage\Noop;
                        break;
                    case 'League\Flysystem\Cached\Storage\PhpRedis':
                    case 'League\Flysystem\Cached\Storage\Predis':
                        $cacheDriver = new \League\Flysystem\Cached\Storage\Predis(\Illuminate\Support\Facades\Redis::connection(Arr::get($config, 'connection', 'default')), Arr::get($config, 'key', 'flysystem'), Arr::get($config, 'expire', null));
                        break;
                    case 'League\Flysystem\Cached\Storage\Stash':
                        if (class_exists('Stash\Pool')) {
                            if (($backend = Arr::get($config, 'backend', false)) !== false && (is_a($backend, 'Stash\Interfaces\DriverInterface') || class_exists($backend))) {
                                if (is_a($backend, 'Stash\Interfaces\DriverInterface')) {
                                    $backendInstance = $backend;
                                } else {
                                    $backendInstance = new $backend;
                                    $backendInstance->setOptions(Arr::get($config, 'options', []));
                                }

                                $pool = new \Stash\Pool($backendInstance);
                            } else {
                                $pool = new \Stash\Pool;
                            }

                            $cacheDriver = new \League\Flysystem\Cached\Storage\Stash($pool, Arr::get($config, 'key', 'flysystem'), Arr::get($config, 'expire', null));
                        } else {
                            return $adapter;
                        }
                        break;
                    default:
                        return $adapter;
                }
            }

            return new \League\Flysystem\Cached\CachedAdapter($adapter, $cacheDriver);
        } else {
            return $adapter;
        }
    }
779323
public function loadComponent($config, $providers, $return = null)
    {
        $this->configure($config);

        foreach ((array) $providers as $provider) {
            $this->register($provider);
        }

        return $this->make($return ?: $config);
    }
740120
protected function configureOptions(array $options = [])
    {
        try {
            $resolver = new OptionsResolver();
            // We set all global options as defined options, otherwise we would get a lot of exceptions
            $resolver->setDefined(array_keys($options));
            $this->resolveOptions($resolver);
            return $resolver->resolve($options);
        } catch (MissingOptionsException $e) {
            throw new InvalidConfigurationException($e->getMessage(), $e->getCode());
        } catch (InvalidOptionsException $e) {
            throw new InvalidConfigurationException($e->getMessage(), $e->getCode());
        } catch (NoConfigurationException $e) {
            throw new InvalidConfigurationException($e->getMessage(), $e->getCode());
        } catch (NoSuchOptionException $e) {
            throw new InvalidConfigurationException($e->getMessage(), $e->getCode());
        } catch (OptionDefinitionException $e) {
            throw new InvalidConfigurationException($e->getMessage(), $e->getCode());
        } catch (UndefinedOptionsException $e) {
            throw new InvalidConfigurationException($e->getMessage(), $e->getCode());
        } catch (ExceptionInterface $e) {
            throw new InvalidConfigurationException($e->getMessage(), $e->getCode());
        }
    }
3643
public static function config($configName, $config = null)
    {
        $_this = Purifier::getInstance();

        if (empty($config)) {
            if (!isset($_this->_configs[$configName])) {
                throw new \InvalidArgumentException(sprintf('Purifier configuration `%s` does not exist!', $configName));
            }
            return $_this->_configs[$configName];
        }

        if (is_array($config)) {
            $purifierConfig = \HTMLPurifier_Config::createDefault();
            foreach ($config as $key => $value) {
                $purifierConfig->set($key, $value);
            }

            return $_this->_configs[$configName] = $purifierConfig;
        } elseif (is_object($config) && is_a($config, 'HTMLPurifier_Config')) {
            return $_this->_configs[$configName] = $config;
        } else {
            throw new \InvalidArgumentException('Invalid purifier config passed!');
        }
    }
1126395
public function getConnectionFromConfiguration(array $config)
    {
        if(empty($config['read']) && !empty($config['solrHost'])) {
            throw new \InvalidArgumentException('Invalid registry data please re-initialize your solr connections');
        }

        return $this->getSolrConnectionForNodes($config['read'], $config['write']);
    }