Simplifying parameter syntax.

@param array $config

@return array
489758
public function getParameters(array $config)
    {
        $params = [
            'opifer_media.media_class' => $config['media']['class'],
            'opifer_media.media_index_view' => $config['media']['views']['index'],
            'opifer_media.media_create_view' => $config['media']['views']['create'],
            'opifer_media.media_edit_view' => $config['media']['views']['edit'],
        ];

        foreach ($config['providers'] as $provider => $options) {
            foreach ($options as $param => $value) {
                $params['opifer_media.providers.'.$provider.'.'.$param] = $value;
            }
        }

        $params['opifer_media.default_storage'] = $config['default_storage'];

        foreach ($config['storages'] as $storage => $options) {
            foreach ($options as $param => $value) {
                $params['opifer_media.storages.'.$storage.'.'.$param] = $value;
            }
        }

        return $params;
    }
823710
protected function prepareDataValue(array $config, array $data): array
    {
        $only = $config['only'] ?? null;
        $except = $config['except'] ?? null;

        if (! \is_null($only)) {
            return Arr::only($data, $only);
        } elseif (! \is_null($except)) {
            return Arr::except($data, $except);
        }

        return $data;
    }
297345
private function getParameters(array $config, $prefix)
    {
        $result = [];

        foreach ($config as $key => $value) {
            $index = sprintf('%s.%s', $prefix, $key);

            if (true === is_array($value)) {
                $result = array_merge($result, $this->getParameters($value, $index));
            } else {
                $result[$index] = $value;
            }
        }

        return $result;
    }
1179842
private function getConfigsForUriTemplates($config)
    {
        $configs = [$config];

        if ($config['additionalBindings']) {
            foreach ($config['additionalBindings'] as $additionalBinding) {
                $configs[] = $additionalBinding + $config;
            }
        }

        return $configs;
    }
940735
public function getSimilar( $config = [] ) {

		$limit	= isset( $config[ 'limit' ] ) ? $config[ 'limit' ] : 5;
		$query	= $this->generateSimilarQuery( $config );

		$query->limit( $limit );

        return $query->all();
	}
559890
public function transform(string $config = ''): array
    {
        $parsed = [];
        if (!empty($config)) {
            $config = \parse_ini_string($config, true, INI_SCANNER_RAW);
            if (\is_array($config)) {
                $parsed = $this->processNode($config);
            }
        }
        return $parsed;
    }
1295221
protected function formatRedirectUrl(array $config)
    {
        $redirect = value($config['redirect']);

        return Str::startsWith($redirect, '/')
                    ? $this->app['url']->to($redirect)
                    : $redirect;
    }
1358321
protected function parseDescriptorField($config)
    {
        if (is_array($config)) {
            $descriptor = [];
            foreach ($config as $field) {
                if (!empty($this->{$field})) {
                    $descriptor[] = $this->{$field};
                }
            }

            return implode(' ', $descriptor);
        } else {
            return $this->{$config};
        }
    }
141899
protected function getParametrizationValues(array $config)
    {
        return [
            'elcodi.entity.image.class' => $config['mapping']['image']['class'],
            'elcodi.entity.image.mapping_file' => $config['mapping']['image']['mapping_file'],
            'elcodi.entity.image.manager' => $config['mapping']['image']['manager'],
            'elcodi.entity.image.enabled' => $config['mapping']['image']['enabled'],

            'elcodi.media_filesystem_service' => $config['filesystem'],

            'elcodi.image_generated_route_host' => $config['images']['generated_route_host'],
            'elcodi.image_view_max_age' => $config['images']['view']['max_age'],
            'elcodi.image_view_shared_max_age' => $config['images']['view']['shared_max_age'],
            'elcodi.image_upload_field_name' => $config['images']['upload']['field_name'],

            'elcodi.image_resize_converter_bin_path' => $config['images']['resize']['converter_bin_path'],
            'elcodi.image_resize_converter_default_profile' => $config['images']['resize']['converter_default_profile'],
        ];
    }
1213370
public function option($config = array())
    {
        $config = new ObjectConfigJson($config);
        $config->append(array(
            'id'        => null,
            'name'      => 'id',
            'value'     => null,
            'label'     => '',
            'disabled'  => false,
            'level'     => 1,
            'attribs'   => array(),
        ));

        $option = new \stdClass;
        $option->id       = $config->id;
        $option->name     = $config->name;
        $option->value 	  = $config->value;
        $option->label    = trim( $config->label ) ? $config->label : $config->value;
        $option->disabled = $config->disabled;
        $option->level    = $config->level;
        $option->attribs  = ObjectConfig::unbox($config->attribs);

        if($config->level) {
            $option->attribs['class'] = array('level'.$config->level);
        }

        if($config->disabled) {
            $option->attribs['class'] = array('k-is-disabled', 'disabled');
        }

        return $option;
    }
574996
protected function convertScrapeConfig(array $config)
	{
		$config['extract'] = $this->convertRegexps($config['extract']);
		$config['match']   = $this->convertRegexps($config['match']);

		return $config;
	}
899813
public static function init($config = [])
    {
        $config = array_merge([
            'accepts' => [],
            'appendTo' => 'body',
            'showBar' => false,
            'editor' => Debugger::$editor,
            'maxDepth' => Debugger::$maxDepth,
            'maxLength' => Debugger::$maxLength,
            'scream' => true,
            'showLocation' => true,
            'strictMode' => true,
            'currentTime' => $_SERVER['REQUEST_TIME_FLOAT'] ?: microtime(true),
            'editorMapping' => isset(Debugger::$editorMapping) === true ? Debugger::$editorMapping : [],
        ], $config);

        Debugger::$editor = $config['editor'];
        Debugger::$maxDepth = $config['maxDepth'];
        Debugger::$maxLength = $config['maxLength'];
        Debugger::$scream = $config['scream'];
        Debugger::$showLocation = $config['showLocation'];
        Debugger::$strictMode = $config['strictMode'];
        Debugger::$time = $config['currentTime'];

        if (isset(Debugger::$editorMapping) === true) {
            Debugger::$editorMapping = $config['editorMapping'];
        }

        return $config;
    }
745541
public function getParameters(array $config)
    {
        $params = [
            'opifer_form.from_email' => $config['from_email'],
            'opifer_form.form_class' => $config['form']['class'],
            'opifer_form.form_index_view' => $config['form']['views']['index'],
            'opifer_form.form_create_view' => $config['form']['views']['create'],
            'opifer_form.form_edit_view' => $config['form']['views']['edit'],

            'opifer_form.post_class' => $config['post']['class'],
            'opifer_form.post_index_view' => $config['post']['views']['index'],
            'opifer_form.post_view_view' => $config['post']['views']['view'],
        ];

        return $params;
    }
388271
private function generateArray(array $config)
    {
        ++$this->indent;

        foreach ($config as $key => $value) {
            if (is_null($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, 'null'));
                } else {
                    $this->writeLine(sprintf('%s,', 'null'));
                }
            } elseif (is_bool($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, $value ? 'true' : 'false'));
                } else {
                    $this->writeLine(sprintf('%s,', $value ? 'true' : 'false'));
                }
            } elseif (is_string($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => '%s',", $key, $value));
                } else {
                    $this->writeLine(sprintf("'%s',", $value));
                }
            } elseif (is_array($value)) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => [", $key));
                } else {
                    $this->writeLine('[');
                }

                $this->generateArray($value);

                $this->writeLine('],');
            } elseif ($value instanceof ClassName) {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, (string) $value));
                } else {
                    $this->writeLine(sprintf('%s,', (string) $value));
                }
            } else {
                if (is_string($key)) {
                    $this->writeLine(sprintf("'%s' => %s,", $key, $value));
                } else {
                    $this->writeLine($value.',');
                }
            }
        }

        --$this->indent;
    }
1109087
private function getMergedConfigValues(array $config)
    {
        $mergedConfig = array();

        foreach ($config as $paymentConfig) {
            $mergedConfig[$paymentConfig->getName()] = $paymentConfig->getValue();
        }

        return $mergedConfig;
    }
719951
public function options( $config = array() )
    {
        $config = new ObjectConfig($config);
        $config->append(array(
            'entity'    => array(),
            'name'      => 'id',
            'value'     => 'id',
            'label'     => 'id',
            'disabled'  => null,
            'attribs'   => array(),
        ));
        $options = array();
        foreach($config->entity as $entity)
        {
            $option = array(
                'id'       => isset($entity->{$config->name}) ? $entity->{$config->name} : null,
                'name'     => $config->name,
                'disabled' => $config->disabled,
                'attribs'  => ObjectConfig::unbox($config->attribs),
                'value'    => $entity->{$config->value},
                'label'    => $entity->{$config->label},
            );
            if($config->entity instanceof \RecursiveIteratorIterator) {
                $option['level'] = $config->entity->getDepth() + 1;
            }
            $options[] = $this->option($option);
        }
        return $options;
    }
883139
public function formatConfig(array $config)
    {
        if (!isset($config['redirectUrl'])) {
//            dd($config);
            $config['redirectUrl'] = $this->formatUrl(value($config['redirect']));;
        }

        if (!isset($config['callbackUrl'])) {
            $config['callbackUrl'] = $this->formatUrl(value($config['callback']));
        }

        return $config;
    }