overrideConfig method.

@param        $fileName
@param string $method

@throws \Illuminate\Contracts\Filesystem\FileNotFoundException
512968
protected function overrideConfig($fileName, $method = 'array_replace_recursive')
    {
        /** @var \Illuminate\Config\Repository $config */
        $config = $this->app->make('config');
        $fileName = str_ensure_right($fileName, '.php');
        $filePath = path_join($this->resolvePath('configPath'), $fileName);
        $overrides = $this->fs->getRequire($filePath);

        foreach ($overrides as $k => $v) {
            if ($config->has($k) && is_array($this->app[ 'config' ]->get($k))) {
                $current = $config->get($k, []);
                $v = $method($current, $v);

            }
            $config->set($k, $v);
        }
    }
938701
private function loadFromFile($filename, $overwrite = false)
    {
        try {
            $yamlDatas = Yaml::parse(file_get_contents($filename));

            if (is_array($yamlDatas)) {
                if (true === $this->debug) {
                    $this->debug_data[$filename] = $yamlDatas;
                }

                if (self::CONFIG_FILE.'.'.self::EXTENSION === basename($filename) ||
                    self::CONFIG_FILE.'.'.$this->environment.'.'.self::EXTENSION === basename($filename)) {
                    foreach ($yamlDatas as $component => $config) {
                        if (!is_array($config)) {
                            $this->container->get('logger')->error('Bad configuration, array expected, given : '.$config);
                        }
                        $this->setSection($component, $config, $overwrite);
                    }
                } else {
                    $this->setSection(basename($filename, '.'.self::EXTENSION), $yamlDatas, $overwrite);
                }
            }
        } catch (ParseException $e) {
            throw new InvalidConfigException($e->getMessage(), null, $e, $e->getParsedFile(), $e->getParsedLine());
        }
    }
649596
public function setFileName($fileName)
	{
		$hasFilename = ($this->fileName !== null);
		
		if ($hasFilename) {
			$previousName = $this->fileName;
			$previousExtension = $this->getExtension();
		}
		
		parent::setFileName($fileName);
		
		if ($hasFilename) {
			
			$newExtension = $this->getExtension();

			if (strcasecmp($previousExtension, $newExtension) !== 0) {

				// restore name back to previous one. Because that's safer.
				parent::setFileName($previousName);

				throw new \RuntimeException('Extension change is not allowed');
			}
		}
	}
1146658
protected function applyRule(MethodNode $method)
    {
        if (preg_match('/^(\_\_|create|get).+/', $method->getName()) !== 0) {
            return;
        }

        $message = sprintf(
            'The factory method %s() violates rule "%s"',
            $method->getName(),
            static::RULE
        );

        $this->addViolation($method, [$message]);
    }
937300
private void overrideConfigFromFile(Configuration config) throws IOException {
    String configFile = GCS_CONFIG_OVERRIDE_FILE.get(config, config::get);
    if (configFile != null) {
      config.addResource(new FileInputStream(configFile));
    }
  }
1254731
public function addMethod(Method $method, $override = false) {
        $methods = $this->getMethods();
        $key = $method->getName();
        if(array_key_exists($key, $methods) && !$override) {
            throw new \Exception('A Method with the name of: ' . $method->getName() . ' already exists');
        }
        $methods[$key] = $method;
        ksort($methods);
        $this->setMethods($methods);
    }
1283404
@Override
    public void setMethod(String method) throws UnsupportedMethodException {
        MethodValues val = MethodValues.match(method, 0, method.length());
        if (null == val) {
            throw new UnsupportedMethodException("Illegal method " + method);
        }
        setMethod(val);
    }
1050560
protected function applyPublicMethodsHaveActionSuffix(MethodNode $method)
    {
        if (substr($method->getName(), -6, 6) === 'Action') {
            return;
        }

        /** @var \PDepend\Source\AST\ASTMethod $method */
        if ($method->isProtected() || $method->isPrivate()) {
            return;
        }

        if ($this->isNotActionMethod($method->getName())) {
            return;
        }

        $this->addViolation(
            $method,
            [
                sprintf(
                    'The controller method %s is not suffixed with "Action" which violates rule "' . static::RULE . '"',
                    $method->getFullQualifiedName()
                ),
            ]
        );
    }
986954
public static function useDefaultEncryptionDriver(string $key, string $method = null): void
    {
        static::throwExceptionIfHasStarted();

        $driver = new DefaultEncryption();
        static::setKeyAndMethod($driver, $key, $method);

        static::$driver = $driver;
    }
247818
public function overrideConfig($file)
    {
        if (!$this->init) {
            $config = Yaml::parse($file);
            $this->config = array_merge_recursive_ex($this->config, $config);
        } else {
            throw new \Exception('Trying to override configuration after init()');
        }
    }
402327
public function setMethod($method)
	{
		parent::setMethod($method);
		$method = strtolower($method);
		if($method == "aes-256-ecb")
		{
			$this->_type = MCRYPT_RIJNDAEL_128;
			$this->_mode = "ecb";
		}
		elseif($method == "aes-256-cbc")
		{
			$this->_type = MCRYPT_RIJNDAEL_128;
			$this->_mode = "cbc";
		}
	}
190944
function overrideConfig(config) {
    if (fs.existsSync(config.config)) {
        var content = fs.readFileSync(config.config, {
            encoding: "utf8"
        });
        var configFile = JSON.parse(content);
        for (var key in configFile) {
            if (configFile.hasOwnProperty(key)) {
                config[key] = configFile[key];
            }
        }
    }
    return config;
}
730355
public function setMethod($method)
    {
        $method = strtolower($method);

        if (in_array($method, [Form::METHOD_GET, Form::METHOD_POST])) {
            $this->method = $method;
        } else {
            throw new \Exception('Incorrect method value given');
        }
        return $this;
    }
142874
protected function driver($method, ...$arguments)
    {
        if ($this->file === null) {
            throw new NoFileSpecifiedException();
        }

        $parts = explode('.', $this->file);
        $suffix = end($parts);
        $driver = DriversManager::get($suffix);

        if ($driver === null) {
            throw new UndefinedDriverException($suffix);
        }

        return call_user_func_array([$driver, $method], $arguments);
    }
1076295
protected function applyNoInstantiationsWithNew(MethodNode $method)
    {
        if (count($method->findChildrenOfType('AllocationExpression')) === 0) {
            return;
        }

        $this->addViolation(
            $method,
            [
                sprintf(
                    'The method %s uses "new" to instantiate an object which violates rule "No instantiations with \'new\'"',
                    $method->getFullQualifiedName()
                ),
            ]
        );
    }
197783
public function getConfigByFilename(string $filename)
    {
        if (!isset($this->config[$filename])) {
            throw new Exception(
                'The file '.$filename.' has not been found',
                $this::ERR_FILE_NOT_FOUND
            );
        }
        
        return $this->config[$filename];
    }
727305
private function doPrepend(ContainerBuilder $container, string $fileName, string $configName): void
    {
        $configFile = __DIR__ . '/../Resources/config/' . $fileName;
        $config = Yaml::parse((string) file_get_contents($configFile));
        $container->prependExtensionConfig($configName, $config);
        $container->addResource(new FileResource($configFile));
    }