@param array $configuration

@return ApplicationConfiguration

@throws Exception
340276
private function createApplicationConfiguration(array $configuration): ApplicationConfiguration
    {
        $resolver = new OptionsResolver();
        $applicationConfiguration = new ApplicationConfiguration();
        $applicationConfiguration->configureOptions($resolver);

        try {
            $applicationConfiguration->setParameters($resolver->resolve($configuration));
        } catch (Exception $exception) {
            throw new Exception(
                'An error has been found when processing the configuration of the admin application',
                0,
                $exception
            );
        }

        return $applicationConfiguration;
    }
668175
public static function build(array $configuration = []): ?TableColumn
    {
        if (!array_key_exists('type', $configuration)) {
            throw new InvalidConfigException('Configuration for TableColumnFactory is missing "type" key.');
        }

        switch ($configuration['type']) {
            case Schema::TYPE_PK:
                return new TableColumnPK($configuration);

            case Schema::TYPE_UPK:
                return new TableColumnUPK($configuration);

            case Schema::TYPE_BIGPK:
                return new TableColumnBigPK($configuration);

            case Schema::TYPE_UBIGPK:
                return new TableColumnBigUPK($configuration);

            case Schema::TYPE_CHAR:
                return new TableColumnChar($configuration);

            case Schema::TYPE_STRING:
                return new TableColumnString($configuration);

            case Schema::TYPE_TEXT:
                return new TableColumnText($configuration);

            case Schema::TYPE_TINYINT:
                return new TableColumnTinyInt($configuration);

            case Schema::TYPE_SMALLINT:
                return new TableColumnSmallInt($configuration);

            case Schema::TYPE_INTEGER:
                return new TableColumnInt($configuration);

            case Schema::TYPE_BIGINT:
                return new TableColumnBigInt($configuration);

            case Schema::TYPE_BINARY:
                return new TableColumnBinary($configuration);

            case Schema::TYPE_FLOAT:
                return new TableColumnFloat($configuration);

            case Schema::TYPE_DOUBLE:
                return new TableColumnDouble($configuration);

            case Schema::TYPE_DATETIME:
                return new TableColumnDateTime($configuration);

            case Schema::TYPE_TIMESTAMP:
                return new TableColumnTimestamp($configuration);

            case Schema::TYPE_TIME:
                return new TableColumnTime($configuration);

            case Schema::TYPE_DATE:
                return new TableColumnDate($configuration);

            case Schema::TYPE_DECIMAL:
                return new TableColumnDecimal($configuration);

            case Schema::TYPE_BOOLEAN:
                return new TableColumnBoolean($configuration);

            case Schema::TYPE_MONEY:
                return new TableColumnMoney($configuration);

            case Schema::TYPE_JSON:
                return new TableColumnJson($configuration);

            default:
                throw new InvalidConfigException("Unsupported schema type '{$configuration['type']}' for TableColumnFactory.");
        }
    }
409525
public function getConfigurationOptions($configurationName)
    {
        if (!array_key_exists($configurationName, $this->configurations)) {
            $errMsg = sprintf('Invalid configuration name %s', $configurationName);
            throw new Exception\InvalidConfigurationNameException($errMsg);
        }

        return new ConfigurationOptions($this->configurations[$configurationName]);
    }
1188034
protected function prepareConfiguration(array $options=null)
    {
        $configuration = clone $this->configuration;
        if (is_array($options)) {
            $options = array_replace($configuration->all(), $options);
            $configuration = new Configuration($options);
        }
        return $configuration;
    }
314558
public static function getInstance(array $config)
    {
        if (empty($config)) {
            throw new \Exception('i18n configuration can not be empty.');
        }
        if (self::$i18n === null) {
            self::$i18n = new self($config);
        }

        return self::$i18n;
    }
1175421
public function setComposerConfiguration(array $configuration)
    {
        $this->composerJsonLoaded = true;
        $this->composerJson = null;
        $this->composerJson = $configuration;

        return $this->composerJson;
    }
1297368
public function setConfiguration(array $configuration): ConfigurationProviderInterface
    {
        if (isset($configuration['configuration']) && $configuration['configuration']) {
            $configuration = array_merge(
                $configuration,
                $this->load($configuration['configuration']),
                array_filter($configuration)
            );
        }

        $this->configuration = $configuration;

        return $this;
    }
998146
private function overrideConfiguration(array $configuration, array $override)
    {
        $configuration['parameters'] = array_replace(
            $configuration['parameters'],
            $override['parameters']
        );

        unset($override['parameters']);

        return array_replace($configuration, $override);
    }
1281813
public function configure(array $configuration) : bool
    {
        //====================================================================//
        // Setup Connector Configuration
        $this->getConnector()->configure(
            $this->getWebserviceId(),
            $this->getWebserviceId(),
            $configuration
        );
        //====================================================================//
        // Mark Connector as Configured
        return $this->identified = true;
    }
805413
public function mergeConfiguration(array $configuration)
    {
        if (isset($configuration['type'])) {
            try {
                $newType = $this->attributeTypeRegistry->getType($configuration['type']);
            } catch (\UnexpectedValueException $e) {
                $attributeTypeCodes = implode(', ', array_keys($this->attributeTypeRegistry->getTypes()));
                $m = "The attribute {$this->code} has an unknown type '{$configuration['type']}'.\n";
                $m .= "Available types are: {$attributeTypeCodes}";
                throw new AttributeConfigurationException($m, 0, $e);
            }
            if ($this->type && $this->type->getDatabaseType() !== $newType->getDatabaseType()) {
                $e = "The attribute '{$this->code}' cannot be overridden with a new attribute type that don't match ";
                $e .= "the database type '{$this->type->getDatabaseType()}'";
                throw new AttributeConfigurationException($e);
            }
            $this->type = $newType;
            unset($configuration['type']);
        }

        $accessor = PropertyAccess::createPropertyAccessor();
        foreach ($configuration as $key => $value) {
            try {
                $accessor->setValue($this, $key, $value);
            } catch (\Exception $e) {
                throw new AttributeConfigurationException(
                    "The attribute {$this->code} has an invalid configuration for option '{$key}'",
                    0,
                    $e
                );
            }
        }

        $this->type->setAttributeDefaults($this); // Allow attribute type service to configure attribute

        $this->checkConflicts();
    }
1263792
public function setConfig(array $config)
    {
        foreach ($config as $key => $value) {
            switch ($key) {
                case 'verbose':
                case 'loadEnv':
                    if (!is_bool($value)) {
                        throw new ConfigurationException($key, 'This should be a boolean value.');
                    }

                    $this->config[$key] = $value;
                    break;

                default:
                    throw new ConfigurationException($key, 'This is an unknown configuration option.');
            }
        }
    }
40700
protected function processConfigurationTraitORM(&$configuration)
    {
        //check parameters
        if(!isset($configuration['subjects'][$this->name]['ORM'])) {
            throw new \Exception(sprintf('missing ORM parameters into %s subject configuration', $this->name));
        } else {
            $parameters = ['table', 'view', 'primaryKey'];
            foreach($parameters as $parameter) {
                if(!isset($configuration['subjects'][$this->name]['ORM'][$parameter]) || !$configuration['subjects'][$this->name]['ORM'][$parameter]) {
                    throw new \Exception(sprintf('missing %s ORM parameters into %s subject configuration', $parameter, $this->name));
                }
            }
            $this->setORMParameters($configuration['subjects'][$this->name]['ORM']['table'], $configuration['subjects'][$this->name]['ORM']['view'], $configuration['subjects'][$this->name]['ORM']['primaryKey']);
        }
    }
1327160
protected function buildTasks(array $configuration)
    {
        $this->io->text('- Building tasks...');
        $builder = new TaskBuilder($this->debug);

        $tasks = $builder->build($configuration);

        $this->io->text('- Tasks build !');
        $this->io->newLine();

        return $tasks;
    }
1059780
public function setup(array $config = [])
    {
        unset($config['request_params'], $config['request_context']);

        if (isset($config['query'])) {
            throw new Exception(translate('{query} can not be initialized'), 500, Exception::BADARGUMENTS);
        }

        if (isset($config['search']) && !is_callable($config['search'])) {
            throw new Exception(translate('{search} must be a callable'), 500, Exception::BADARGUMENTS);
        }

        if (!isset($config['data_source'])) {
            throw new Exception(translate('{data_source} must be a ActiveRecord objetc'), 500, Exception::BADARGUMENTS);
        } elseif (isset($config['data_source']) && !($config['data_source'] instanceof ActiveRecordInterface)) {
            throw new Exception(translate('{data_source} must be a ActiveRecord objetc'), 500, Exception::BADARGUMENTS);
        }

        foreach ($config as $property => $data) {
            if (property_exists($this, '_'.$property)) {
                $this->{'_'.$property} = $data;
            } elseif (property_exists($this, $property)) {
                $this->{$property} = $data;
            }
        }
    }
275669
private function checkTransitionsConfiguration(array $configuration)
    {
        foreach ($configuration as $transitionConfiguration) {
            if (
                is_array($transitionConfiguration) &&
                (count($transitionConfiguration) === 3) &&
                isset($transitionConfiguration[0]) &&
                is_string($transitionConfiguration[0]) &&
                $transitionConfiguration[0] &&
                isset($transitionConfiguration[1]) &&
                is_string($transitionConfiguration[1]) &&
                $transitionConfiguration[1] &&
                isset($transitionConfiguration[2]) &&
                is_string($transitionConfiguration[2]) &&
                $transitionConfiguration[2]
            ) {
                return $this;
            }
        }

        throw new TransitionNotValidException();
    }
581146
static public function getInstance( $configuration = array() )
    {
        if (empty( self::$instance )) {
            self::$instance = new App( $configuration );
        }
        return self::$instance;
    }
67635
public static function create(array $configuration)
    {
        $currentConfiguration = is_array($configuration) ? array_merge(self::$defaultConfiguration, $configuration)
            : self::$defaultConfiguration;

        $class = self::className($currentConfiguration);

        $adapter = new $class($currentConfiguration[Config::PARAMS]);

        return new Storage($adapter);
    }