Processes the Finders configuration list.

@param array $config The configuration.

@return Finder[] The list of Finders.

@throws InvalidArgumentException If the configured method does not exist.
351202
private function processFinders(array $config)
    {
        $finders = array();
        $filter = $this->getBlacklistFilter();

        foreach ($config as $methods) {
            $finder = Finder::create()
                        ->files()
                        ->filter($filter)
                        ->ignoreVCS(true);

            if (isset($methods->in)) {
                $base = $this->getBasePath();
                $methods->in = (array) $methods->in;

                array_walk(
                    $methods->in,
                    function (&$directory) use ($base) {
                        $directory = Path::canonical(
                            $base . DIRECTORY_SEPARATOR . $directory
                        );
                    }
                );
            }

            foreach ($methods as $method => $arguments) {
                if (false === method_exists($finder, $method)) {
                    throw new InvalidArgumentException(
                        sprintf(
                            'The method "Finder::%s" does not exist.',
                            $method
                        )
                    );
                }

                $arguments = (array) $arguments;

                foreach ($arguments as $argument) {
                    $finder->$method($argument);
                }
            }

            $finders[] = $finder;
        }

        return $finders;
    }
726947
protected function normalizeClientConfig(array $config)
    {
        if (! isset($config['client'])) {
            $config['client'] = ['url' => $config['url']];
        } elseif (is_string($config['client'])) {
            $client = Arr::get($this->config, 'clients.'.$config['client']);

            if ($client == null) {
                throw new InvalidArgumentException('Client '.$config['client'].' doesn\'t configured.');
            }

            $config['client'] = $client;
        }

        return $config;
    }
1259981
private function normalizeConfig(array $config)
    {
        // Backwards compatibility with old config format: `toolstack` is
        // changed to application `type` and `build`.`flavor`.
        if (isset($config['toolstack'])) {
            if (!strpos($config['toolstack'], ':')) {
                throw new InvalidConfigException("Invalid value for 'toolstack'");
            }
            list($config['type'], $config['build']['flavor']) = explode(':', $config['toolstack'], 2);
        }

        // The `web` section has changed to `web`.`locations`.
        if (isset($config['web']['document_root']) && empty($config['web']['locations'])) {
            $oldConfig = $config['web'] + $this->getOldWebDefaults();

            $location = &$config['web']['locations']['/'];

            $location['root'] = $oldConfig['document_root'];
            $location['expires'] = $oldConfig['expires'];
            $location['passthru'] = $oldConfig['passthru'];
            $location['allow'] = true;

            foreach ($oldConfig['whitelist'] as $pattern) {
                $location['allow'] = false;
                $location['rules'][$pattern]['allow'] = true;
            }

            foreach ($oldConfig['blacklist'] as $pattern) {
                $location['rules'][$pattern]['allow'] = false;
            }
        }

        return $config;
    }
81542
private function setConfig(array $config)
    {
        if (! array_key_exists('processing', $config))                                 throw new \InvalidArgumentException('Missing the root key processing in configuration');
        if (! array_key_exists('node_name', $config['processing']))                    throw new \InvalidArgumentException('Missing key node_name in processing config');
        if (! array_key_exists('plugins', $config['processing']))                      throw new \InvalidArgumentException('Missing key plugins in processing config');
        if (! is_array($config['processing']['plugins']))                              throw new \InvalidArgumentException('Plugins must be an array in processing config');
        if (! array_key_exists('connectors', $config['processing']))                   throw new \InvalidArgumentException('Missing key connectors in processing config');
        if (! is_array($config['processing']['connectors']))                           throw new \InvalidArgumentException('Connectors must be an array in processing config');
        if (! array_key_exists('channels', $config['processing']))                     throw new \InvalidArgumentException('Missing key channels in processing config');
        if (! is_array($config['processing']['channels']))                             throw new \InvalidArgumentException('Channels must be an array in processing config');
        if (! isset($config['processing']['channels']['local']))                       throw new \InvalidArgumentException('Missing local channel config in processing.channels');
        if (! array_key_exists('processes', $config['processing']))                    throw new \InvalidArgumentException('Missing key processes in processing config');
        if (! is_array($config['processing']['processes']))                            throw new \InvalidArgumentException('Processes must be an array in processing config');
        if (! array_key_exists('js_ticker', $config['processing']))                    throw new \InvalidArgumentException('Missing key js_ticker in processing config');
        if (! is_array($config['processing']['js_ticker']))                            throw new \InvalidArgumentException('js_ticker must be an array in processing config');

        $this->assertChannelConfig($config['processing']['channels']['local'], 'local');

        $projection = new \Prooph\Link\Application\Projection\ProcessingConfig($config, $this->configLocation, true);

        foreach ($config['processing']['processes'] as $startMessage => $processConfig) {
            $this->assertMessageName($startMessage, $projection->getAllAvailableProcessingTypes());
            $this->assertProcessConfig($startMessage, $processConfig);
        }

        foreach ($config['processing']['connectors'] as $connectorId => $connectorConfig)
        {
            if (! is_array($connectorConfig)) throw new \InvalidArgumentException(sprintf('Connector config for connector %s must be an array', $connectorId));
            $this->assertConnectorConfig($connectorId, $connectorConfig, $projection, false);
        }

        $this->assertJsTickerConfig($config['processing']['js_ticker']);

        $this->config = $config;
    }
940451
private function configureOptions(array $config): array
    {
        $resolver = new OptionsResolver();
        $resolver->setDefaults([
            'device' => [],
        ]);

        $resolver->setRequired(['message']);
        $resolver->setAllowedTypes('message', 'array');
        $resolver->setAllowedTypes('device', 'array');

        $options = $resolver->resolve($config);

        $deviceResolver = new OptionsResolver();
        $options['device'] = $deviceResolver->resolve($options['device']);

        $messageResolver = new OptionsResolver();
        $messageResolver->setRequired(['defaultTitle', 'defaultMediaUrl', 'defaultActionUrl']);

        $messageResolver->setAllowedTypes('defaultTitle', 'string');
        $messageResolver->setAllowedTypes('defaultMediaUrl', 'string');
        $messageResolver->setAllowedTypes('defaultActionUrl', 'string');

        $options['message'] = $messageResolver->resolve($options['message']);

        return $options;
    }
176671
private function processConfig($config)
    {
        $period = null;

        if ($config == 'mostviewed') {
            $period = $this->scopeConfig->getValue(
                self::XML_PATH_MOSTVIEWED_TIME_PERIOD
            );
        } elseif ($config == 'bestsellers') {
            $period = $this->scopeConfig->getValue(
                self::XML_PATH_BESTSELLER_TIME_PERIOD
            );
        } elseif ($config == 'recentlyviewed') {
            $period = $this->scopeConfig->getValue(
                self::XML_PATH_MOSTVIEWED_TIME_PERIOD
            );
        }
        return $period;
    }
644887
protected function getConfigs()
    {
    	if (!$configs = $this->container->getParameter($this->getRequest()->get('config_identifier', 'none'))){
            throw new \InvalidArgumentException('Configs does no exist!');
    	}
    	
    	return $configs;
    }
1233248
protected function getConfig(array $config)
    {
        if (!array_key_exists('prefix', $config)) {
            $config['prefix'] = null;
        }

        if (!array_key_exists('bucket', $config)) {
            throw new InvalidArgumentException('The awss3 connector requires bucket configuration.');
        }

        return array_only($config, ['bucket', 'prefix']);
    }
93593
protected function getConfigData($config)
    {
        if (is_string($config)) {
            if (!file_exists($config)) {
                throw new \InvalidArgumentException("Config file $config not found");
            }
            $this->loadConfigFile($config);
        } elseif (is_array($config)) {
            $this->loadFromHash($config);
        }

        $this->loadConfigFile('iron.ini');
        $this->loadConfigFile('iron.json');

        $this->loadFromEnv(strtoupper($this->product_name));
        $this->loadFromEnv('IRON');

        if (!ini_get('open_basedir')) {
            $this->loadConfigFile(self::homeDir() . '.iron.ini');
            $this->loadConfigFile(self::homeDir() . '.iron.json');
        }

        $this->loadFromHash($this->default_values);

        if (empty($this->token) || empty($this->project_id)) {
            throw new \InvalidArgumentException("token or project_id not found in any of the available sources");
        }
    }
860298
protected function buildHandlers(array $config):array
    {
        $handlers = [];
        foreach ($config as $handler) {
            $level = constant('\Mostofreddy\Loggy\Logger::'. strtoupper($handler['level']));
            $handlerObj = '\Mostofreddy\Loggy\Handler\\'.ucfirst($handler['handler']);
            $handlers[] = (new $handlerObj($level))->config($handler);
        }
        return $handlers;
    }
532953
protected function getOptionsFromConfig(Config $config)
    {
        $options = [];

        if ($visibility = $config->get('visibility')) {
            $options['predefinedAcl'] = $this->getPredefinedAclForVisibility($visibility);
        } else {
            // if a file is created without an acl, it isn't accessible via the console
            // we therefore default to private
            $options['predefinedAcl'] = $this->getPredefinedAclForVisibility(AdapterInterface::VISIBILITY_PRIVATE);
        }

        if ($metadata = $config->get('metadata')) {
            $options['metadata'] = $metadata;
        }

        return $options;
    }
1194174
protected function getAuth(array $config)
	{
		if (isset($config['key']) && trim($config['key']) != '')
		{
			return array('key' => $config['key'], 'keyphrase' => $config['keyphrase']);
		}
		elseif (isset($config['keytext']) && trim($config['keytext']) != '')
		{
			return array('keytext' => $config['keytext']);
		}
		elseif (isset($config['password']))
		{
			return array('password' => $config['password']);
		}

		throw new \InvalidArgumentException('Password / key is required.');
	}
746707
protected function getOptionsFromConfig(Config $config)
    {
        $options = [];

        if ($config->has('visibility')) {
            switch (true) {
                case $config->get('visibility') === AdapterInterface::VISIBILITY_PUBLIC:
                    $options['predefinedAcl'] = static::GCS_VISIBILITY_PUBLIC_READ;
                    break;
                case $config->get('visibility') === AdapterInterface::VISIBILITY_PRIVATE:
                default:
                    $options['predefinedAcl'] = static::GCS_VISIBILITY_PROJECT_PRIVATE;
                    break;
            }
        }

        return $options;
    }
192384
public static function process($config = array())
	{
		foreach (static::$upload->getAllFiles() as $file)
		{
			$file->setConfig($config);
			$file->validate();
		}
	}
1061631
public function getConfigItems($config) {
		$config = strtolower($config);
		return isset($this->config[$config]) ? $this->config[$config] : array();
	}
358974
protected function processArguments(array $args) {
		$definition = [];
		
		foreach ($args as $arg) {
			if ($arg->getName() !== 'argument') {
				throw new InvalidConfig('Unknown element "' . $arg->getName() . '" in arguments definition', null, null, $arg);
			}

			$definition[] = $this->processArgument($arg);
		}
		
		return $definition;
	}
745903
public function setConfig($config)
    {
        if (is_string($config)) {
            // Treat the parameter as a filepath
            $this->config = $this->createConfig($config);
        } elseif (is_array($config)) {
            $this->config = $this->createConfig($config);
        } elseif ($config instanceof ConfigInterface) {
            $this->config = $config;
        } else {
            throw new InvalidArgumentException(sprintf(
                'Configset must be an associative array, a file path, or an instance of %s',
                ConfigInterface::class
            ));
        }

        return $this;
    }