Return a map of environment variables to callables.

@param Configuration $config
@return array
324684
private function initMappings(Configuration $config)
    {
        $this->mappings = [
            'PERIDOT_GREP' => [$config, 'setGrep'],
            'PERIDOT_REPORTER' => [$config, 'setReporter'],
            'PERIDOT_PATH' => [$config, 'setPath'],
            'PERIDOT_COLORS_ENABLED' => [$this, 'handleBooleanEnv', false, [$config, 'disableColors']],
            'PERIDOT_STOP_ON_FAILURE' => [$this, 'handleBooleanEnv', true, [$config, 'stopOnFailure']],
            'PERIDOT_DSL' => [$config, 'setDsl'],
            'PERIDOT_CONFIGURATION_FILE' => [$config, 'setConfigurationFile']
        ];
    }
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;
    }
1120287
protected function getModule($moduleConfig)
    {
        if (!file_exists($moduleConfig)) {
            return [];
        }

        $moduleConfigContent = file_get_contents($moduleConfig);

        return Yaml::parse($moduleConfigContent);
    }
137948
public function getIdList( $config = [] ) {

		$modelClass	= static::$modelClass;
		$modelTable	= $this->getModelTable();

		$config[ 'conditions' ][ "$modelTable.type" ] = static::$parentType;

		return parent::getIdList( $config );
	}
1057035
private function mapLaravelToDoctrineConfig($config)
    {
        $default = $config['database.default'];
        $connection = $config["database.connections.{$default}"];
        return App::make(DriverMapper::class)->map($connection);
    }
963119
public static function config($config = null)
	{
		if(is_array($config)) {

            # Setting Configurations
			static::$config = $config + static::$config;
			$pathWithoutTrailingSlash = rtrim(static::$config['directory'], '/');
			static::$config['directory'] = $pathWithoutTrailingSlash.'/';

		} elseif(is_string($config)) {

            # Getting Single Config item
			return isset(static::$config[$config]) ? static::$config[$config] : null;

		} elseif(!$config) {

            # Getting All configurations
			return static::$config;
		} else {
			throw new CacheException('Invalid parameter provided for Cache::config()');
		}
	}
808007
public function configure($config = [])
    {
        return new static ([
            'driver'   => 'pdo_sqlite',
            'user'     => array_get($config, 'username'),
            'password' => array_get($config, 'password'),
            'prefix'   => array_get($config, 'prefix'),
            'memory'   => $config['database'] == ':memory' ? true : false,
            'path'     => $config['database'] == ':memory' ? null : $config['database']
        ]);
    }
496436
protected function parseConfig(array $config): array
    {
        $result = [];
        foreach ($config as $key => $type) {
            if (\is_array($type)) {
                if ($arrayOfType = $this->factory->checkArrayOfType($type)) {
                    $result[$key] = $arrayOfType;
                } else {
                    $result[$key] = new self($type, $this->factory, $this->strict);
                }
            } elseif ($type instanceof CastInterface) {
                $result[$key] = $type;
            } else {
                $result[$key] = $this->factory->createType($type);
            }
        }

        return $result;
    }
893312
public function transform(string $config = ''): array
    {
        $parsed = [];
        if (!empty($config)) {
            $decoded = @\json_decode($config, true, 512);
            $parsed = $decoded !== null ? $decoded : [];
        }
        return $parsed;
    }
176199
public function generateSortAttributes(Config $config)
    {
        $sortAttributes = [];
        foreach ($config->getPointerPlugins('list') as $plugin) {
            $sortAttributes = ArrayHelper::merge($plugin->getSortField(), $sortAttributes);
        }

        return $sortAttributes;
    }
134744
private static function preformPlaceHolder(array $config): array
    {
        $preform = [];

        foreach ($config as $name => $value) {
            if (Assert::array($value)) {
                $preform[$name] = static::preformPlaceHolder($value);
            } elseif (Assert::string($value)) {
                $preform[$name] = trim($value);

                foreach (static::$placeholders as $placeholder => $path) {
                    if (Assert::contains($preform[$name], $placeholder)) {
                        $preform[$name] = str_replace($placeholder, $path, $preform[$name]);
                    }
                }
            } else {
                $preform[$name] = trim($value);
            }
        }

        return $preform;
    }
1214439
public static function generate(Configuration $config)
    {
        // Reduce memory usage by omitting args and objects from backtrace
        $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS & ~DEBUG_BACKTRACE_PROVIDE_OBJECT);

        return static::fromBacktrace($config, $backtrace, '[generator]', 0);
    }
1346023
protected function loadInstalledComponentsConfig(array $config = []) : array
    {
        $env    = $this->env === self::WEB ? 'web' : 'console';
        $config = FileHelper::loadExtensionsFiles('config/main.php',   $config);
        $config = FileHelper::loadExtensionsFiles("config/{$env}.php", $config);
        return $config;
    }
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;
    }
853365
public static function generateMap( $config = [] ) {

		$parentType = static::$parentType;

		// column alias
		$defaultValue	= preg_replace( '/-/', ' ', $parentType );
		$default		= $config[ 'default' ] ?? false;
		$defaultValue	= $config[ 'defaultValue' ] ?? ucfirst( $defaultValue );

		$nameAlias		= $config[ 'nameAlias' ] ?? 'name';
		$valueAlias		= $config[ 'valueAlias' ] ?? 'value';

		$arrayList		= static::generateNameValueList( $config );
		$map			= $default ? [ '0' => "Choose $defaultValue" ] : [];

		foreach( $arrayList as $item ) {

			$map[ $item[ $nameAlias ] ] = $item[ $valueAlias ];
		}

		return $map;
	}
278917
public function dump(Config $config)
    {
        $ignored = [
            'commands',
        ];

        $ignored = array_fill_keys($ignored, true);

        $output = '';

        $a = [];
        foreach ($config as $key => $value) {
            if (isset($ignored[$key])) {
                continue;
            }

            if ('uses' === $key) {
                $value = array_keys($value);
                $key = 'extensions';
            }

            $a[$key] = $value;
        }

        ksort($a);

        foreach ($a as $key => $value) {
            if ('_' === $key{0}) {
                continue;
            }
            $output .= sprintf(
                'export %s="%s"%s',
                $this->formatEnvironmentVariableName($key),
                $this->formatEnvironmentVariableValue($value),
                PHP_EOL
            );
        }

        return $output;
    }
139414
protected function getPlugins(array $config)
    {
        if (!isset($config['plugins']) || !is_array($config['plugins'])) {
            throw new \RuntimeException(
                'Configuration must contain "plugins" key referencing an array',
                self::ERR_PLUGINS_NONARRAY
            );
        }

        $filtered = array_filter(
            $config['plugins'],
            function($plugin) {
                return !$plugin instanceof PluginInterface;
            }
        );
        if ($filtered) {
            throw new \RuntimeException(
                'Configuration "plugins" key must contain only objects'
                    . ' implementing \Phergie\Irc\Bot\React\PluginInterface',
                self::ERR_PLUGINS_NONPLUGINS
            );
        }

        return $config['plugins'];
    }