@param array $config

@return array
509501
protected function buildCssWithLess(array $config)
    {
        $less_outfile = $this->normalizePath(dirname(dirname(dirname(__FILE__))), 'Resources', 'build', 'bootswatch.less');
        $inputs = array(
            $less_outfile
        );

        $output = array();
        $output['bootstrap_css'] = array(
            'inputs' => $inputs,
            'filters' => array(
                "exposed",
                $config['less_filter']
            ),
        );
        $output['font_awesome_css'] = array(
            'inputs' => array(
                $this->normalizePath($config['bootswatch']['path'], 'bower_components/font-awesome/less/font-awesome.less'),
            ),
            'filters' => array(
                "exposed",
                $config['less_filter']
            ),
        );
        return $output;
    }
897469
public static function getConfig(array $appConfig = []) : array
  {
    $configs = DEPConfig::$appdir . 'config' . DIRECTORY_SEPARATOR . '*.php';

    foreach (\glob($configs) as $config) {
      $service = require $config;

      if (is_array($service)) {
        $path = basename($config);
        $name = \substr($path, 0, strlen($path) - 4);
        $appConfig = array_merge($appConfig, [$name => $service]);
      }
    }

    return $appConfig;
  }
966032
protected function parseConfig(string $config): array
    {
        $config = json_decode($config, true);
        if ($config === null) {
            throw new ConfigFileFormatException("Config files should be written in valid JSON");
        }
        return $config;
    }
379976
protected function convertValueTypes(array $config)
	{
		foreach ($config as $k => $v)
		{
			if (is_array($v))
			{
				$config[$k] = $this->convertValueTypes($v);
			}
			else
			{
				$config[$k] = $this->castConfigValue($k, $v);
			}
		}

		return $config;
	}
789337
protected function _prepareConnectionParams(array $config)
    {
        $params = [];
        $params['config'] = [];
        foreach ($config as $key => $value) {
            if (\in_array($key, ['bigintConversion', 'curl', 'headers', 'url'])) {
                $params['config'][$key] = $value;
            } else {
                $params[$key] = $value;
            }
        }

        return $params;
    }
130344
final protected function getConfigs($config = null)
    {
        if (null !== $config) {
            if (array_key_exists($config, self::$_configs)) {
                return self::$_configs[$config];
            } else {
                return false;
            }
        }

        return self::$_configs;
    }
769137
final public function get(array $appConfig): array
    {
        $defaults = $this->getSettings();

        $policiesFolder   = $defaults[static::KEY_POLICIES_FOLDER] ?? null;
        $policiesFileMask = $defaults[static::KEY_POLICIES_FILE_MASK] ?? null;

        assert(
            $policiesFolder !== null && empty(glob($policiesFolder)) === false,
            "Invalid Policies folder `$policiesFolder`."
        );
        assert(empty($policiesFileMask) === false, "Invalid Policies file mask `$policiesFileMask`.");
        $policiesPath = $policiesFolder . DIRECTORY_SEPARATOR . $policiesFileMask;

        $topPolicyName = $defaults[static::KEY_TOP_POLICY_NAME];

        $loader = (new AuthorizationRulesLoader($policiesPath, $topPolicyName));

        return $defaults + [
                static::KEY_POLICIES_DATA => $loader->getRulesData(),
            ];
    }
1137697
private function translateLabels(array $config): array
    {
        foreach ($config as $tagName => $tagConfig) {
            $config[$tagName]['label'] = $this->translator->trans(
                /** @Ignore */
                $tagConfig['label'],
                [],
                $this->translationDomain
            );
            $config[$tagName]['description'] = $this->translator->trans(
                /** @Ignore */
                $tagConfig['description'],
                [],
                $this->translationDomain
            );

            if (empty($tagConfig['attributes'])) {
                continue;
            }

            foreach ($tagConfig['attributes'] as $attributeName => $attributeConfig) {
                $config[$tagName]['attributes'][$attributeName]['label'] = $this->translator->trans(
                    /** @Ignore */
                    $attributeConfig['label'],
                    [],
                    $this->translationDomain
                );
            }
        }

        return $config;
    }
230369
public function getParameters(array $config)
    {
        $params = [
            'opifer_content.content_class' => $config['content']['class'],
            'opifer_content.content_index_view' => $config['content']['views']['index'],
            'opifer_content.content_type_view' => $config['content']['views']['type'],
            'opifer_content.content_edit_type' => $config['content']['views']['edit_type'],
            'opifer_content.content_select_type' => $config['content']['views']['select_type'],
            'opifer_content.content_select_site' => $config['content']['views']['select_site'],
            'opifer_content.content_select_layout_type' => $config['content']['views']['select_layout_type'],
            'opifer_content.content_new_view' => $config['content']['views']['new'],
            'opifer_content.content_design_view' => $config['content']['views']['design'],
            'opifer_content.content_edit_view' => $config['content']['views']['edit'],
            'opifer_content.content_details_view' => $config['content']['views']['details'],
            'opifer_content.content_history_view' => $config['content']['views']['history'],
            'opifer_content.content_type_class' => $config['content_type']['class'],
            'opifer_content.content_type_index_view' => $config['content_type']['views']['index'],
            'opifer_content.content_type_create_view' => $config['content_type']['views']['create'],
            'opifer_content.content_type_edit_view' => $config['content_type']['views']['edit'],
        ];

        // Block configuration
        foreach ($config['blocks'] as $block => $blockConfig) {
            $params['opifer_content.'.$block.'_block_configuration'] = $blockConfig;
        }

        return $params;
    }
872546
public static function config($config = []) {
		if (!$config) {
			return ['rules' => static::$_rules];
		}
		foreach ($config as $key => $val) {
			if (isset(static::${'_' . $key})) {
				static::${'_' . $key} = $val + static::${'_' . $key};
			}
		}
	}
809528
public function initialize(array $config)
    {
        $this->belongsToMany('Roles', [
            'className' => 'User.Roles',
            'joinTable' => 'users_roles',
            'through' => 'UsersRoles',
            'propertyName' => 'roles',
        ]);
        $this->addBehavior('Timestamp', [
            'events' => [
                'Model.beforeSave' => [
                    'created' => 'new',
                ],
                'Users.login' => [
                    'last_login' => 'always'
                ]
            ]
        ]);
        $this->addBehavior('Search.Searchable', [
            'fields' => function ($user) {
                $words = '';
                $words .= empty($user->name) ?: " {$user->name}";
                $words .= empty($user->username) ?: " {$user->username}";
                $words .= empty($user->email) ?: " {$user->email}";
                $words .= empty($user->web) ?: " {$user->web}";

                if (!empty($user->_fields)) {
                    foreach ($user->_fields as $vf) {
                        $words .= ' ' . trim($vf->value);
                    }
                }

                return $words;
            }
        ]);
        $this->addBehavior('Field.Fieldable');

        $this->addSearchOperator('created', 'Search.Date', ['field' => 'created']);
        $this->addSearchOperator('limit', 'Search.Limit');
        $this->addSearchOperator('email', 'Search.Generic', ['field' => 'email', 'conjunction' => 'auto']);
        $this->addSearchOperator('order', 'Search.Order', ['fields' => ['name', 'username', 'email', 'web']]);
    }
407487
public function transform(string $config = ''): array
    {
        $parsed = [];

        if (!\extension_loaded('php_yaml')) {
            return $parsed;
        }
        if (!empty($config)) {
            $parsed = \yaml_parse($config);
            $parsed = $parsed !== null ? $parsed : [];
        }

        return $parsed;
    }
959287
public function getTokens(array $config = [])
    {
        $query = $this->hasMany(
            Token::class,
            ['providerId' => 'id']
        );

        if (!empty($config)) {
            QueryHelper::configure(
                $query,
                $config
            );
        }

        return $query;
    }
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;
    }
395944
public static function invoke(
        array $fieldsConfig
    ): array {
        $fieldsConfigByName = [];
        foreach ($fieldsConfig as $fieldConfig) {
            $name = Property::getRequired(
                $fieldConfig,
                FieldConfig::NAME
            );
            $fieldsConfigByName[$name] = $fieldConfig;
        }

        return $fieldsConfigByName;
    }
347353
public function getRepeaterMapping(array $config)
    {
        $mapping = ['data' => null];
        $mapping['data'] = $this->setRepeaters(null, null, $config);

        return $mapping;
    }
566085
public function getOptions(array $config)
    {
        $options = Arr::get($config, 'options', []);

        return array_diff_key($this->options, $options) + $options;
    }