overrideConfig method.

@param        $fileName
@param string $method

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

        foreach ($overrides as $k => $v) {
            if ($config->has($k) && is_array($config->get($k))) {
                $v = call_user_func($method, $config->get($k, []), $v);
            }
            $config->set($k, $v);
        }
    }
548117
private static function addConfigFromFile($filename)
    {
        $file_path = self::$default_dir . $filename . ".php";

        if (! file_exists($file_path)) {
            $err_msg = "The file '" . str_replace(['\\','/'], DIRECTORY_SEPARATOR, $file_path) . "' is not found!";
            throw new \Exception($err_msg);
        }

        self::$settings[$filename] = new \Phalcon\Config\Adapter\Php($file_path);
    }
656101
public function setFilename($filename)
    {
        if (is_array($filename) && isset($filename['name'])) {
            $this->filename = $filename['name'];
        } else {
            $this->filename = $filename;
        }
    }
1226913
protected function applyRule(MethodNode $method)
    {
        $params = $method->getParameters();
        foreach ($params as $param) {
            $this->checkParameter($param, $method);
        }
    }
1309247
public function exposePaths(ExposeMethod $method)
    {
        // No-op if exposure not necessary for this configuration
        if (!$this->requiresExpose()) {
            return;
        }
        $folders = $this->getExposedFolders();
        $sourcePath = $this->getPath();
        $targetPath = $this->getPublicPath();
        foreach ($folders as $folder) {
            // Get paths for this folder and delegate to expose method
            $folderSourcePath = Util::joinPaths($sourcePath, $folder);
            $folderTargetPath = Util::joinPaths($targetPath, $folder);
            $method->exposeDirectory($folderSourcePath, $folderTargetPath);
        }
    }
579139
public function setMethod($method)
    {
      if(!is_string($method) && strlen(trim($method)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid method, must be a non empty string');

      $this->method = $method;
    }
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));
    }
  }
1347156
public static function resolveConfigHandler($fileName)
    {
        $configHandler = NULL;

        preg_match("/(\.)([a-z]{3,})/", $fileName, $matches);

        $fileExtension = $matches[2];

        if (!in_array($fileExtension, ConfigConsts::getExtensions())) {
            throw new ConfigException("Not correct config file extension.");
        }

        switch ($fileExtension) {
            case(ConfigConsts::INI):
                $configHandler = new ConfigIniHandler();
                break;
            default:
                throw new ConfigException("Config handler wasn't set.");
        }

        return $configHandler;
    }
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);
    }
435100
public function setMethod($method) {
        $methods = array(
            COMPLETION_AGGREGATION_ALL,
            COMPLETION_AGGREGATION_ANY,
        );

        if (in_array($method, $methods)) {
            $this->method = $method;
        } else {
            $this->method = COMPLETION_AGGREGATION_ALL;
        }
    }
940010
public function method($method)
    {
        $this->headers = array_merge($this->headers, array('X-HTTP-Method-Override: ' . $method));
        $this->setOption(CURLOPT_CUSTOMREQUEST, $method);
        $this->setOption(CURLOPT_HTTPHEADER, $this->headers);
    }
932325
public static function load(string $filename): ConfigInterface
    {
        if (!file_exists($filename)) {
            throw new \RuntimeException(sprintf('Expected config in %s, but the file does not exist.', $filename), 1);
        }
        // Try to determine the realpath of the file, if possible.
        $filename = realpath($filename) ?: $filename;
        try {
            $config = require $filename;
        } catch (Exception $e) {
            throw new \RuntimeException(sprintf('There was an error loading config from %s. Message: %s', $filename, $e->getMessage()), 1, $e);
        }
        if (1 === $config) {
            throw new \RuntimeException(sprintf('No configuration was returned from %s.', $filename), 1);
        }
        if (!$config instanceof ConfigInterface) {
            throw new \RuntimeException(sprintf('Configuration returned from %s is not an instance of %s.', $filename, ConfigInterface::class), 1);
        }
        if ('' === $config->getDocroot()) {
            $config->setDocroot(dirname($filename));
        }
        if ('' === $config->getCachePrefix()) {
            $config->setCachePrefix(md5($filename));
        }

        return $config;
    }
189629
private void overrideAbstractMethods() throws IOException
    {
        for (final ExecutableElement method : El.getEffectiveMethods(superClass))
        {
            if (method.getModifiers().contains(Modifier.ABSTRACT))
            {
                if (
                        method.getAnnotation(Terminal.class) != null || 
                        method.getAnnotation(Rule.class) != null || 
                        method.getAnnotation(Rules.class) != null )
                {
                    implementedAbstractMethods.add(method);
                    MethodCompiler mc = new MethodCompiler()
                    {
                        @Override
                        protected void implement() throws IOException
                        {
                            TypeMirror returnType = method.getReturnType();
                            List<? extends VariableElement> params = method.getParameters();
                            if (returnType.getKind() != TypeKind.VOID && params.size() == 1)
                            {
                                nameArgument(ARG, 1);
                                try
                                {
                                    convert(ARG, returnType);
                                }
                                catch (IllegalConversionException ex)
                                {
                                    throw new IOException("bad conversion with "+method, ex);
                                }
                                treturn();
                            }
                            else
                            {
                                if (returnType.getKind() == TypeKind.VOID && params.size() == 0)
                                {
                                    treturn();
                                }
                                else
                                {
                                    throw new IllegalArgumentException("cannot implement abstract method "+method);
                                }
                            }
                        }
                    };
                    subClass.overrideMethod(mc, method, Modifier.PROTECTED);
                }
            }
        }
    }
70238
public function run($method) {
		$this->$method();
		$reflection = new \ReflectionClass($this);
		$packages = \Skeleton\Core\Skeleton::get_all();
		$filename = $reflection->getFileName();

		if (substr(Config::$migration_directory, -1) == '/') {
			$migration_directory = substr(Config::$migration_directory, 0, -1);
		} else {
			$migration_directory = Config::$migration_directory;
		}

		if (dirname($filename) == $migration_directory) {
			Runner::set_version('project', $this->get_version());
			return;
		}

		$migration_package = null;
		foreach ($packages as $package) {
			if (strpos($package->migration_path, dirname($filename)) === 0) {
				$migration_package = $package;
			}
		}

		if ($migration_package === null) {
			throw new \Exception('No package found');
		}

		Runner::set_version($migration_package->name, $this->get_version());
	}
131702
public function theOperationInFile($filename)
    {
        $queryFile = sprintf('%s%s%s', self::$currentFeatureFile->getPath(), DIRECTORY_SEPARATOR, $filename);
        if (file_exists($queryFile)) {
            $file = new File($queryFile);
            $this->client->setGraphQL(file_get_contents($file->getPathname()));
        } else {
            throw new FileNotFoundException(null, 0, null, $queryFile);
        }
    }
1142914
public function setObject($object, $method  = null)
    {
        if (! is_object($object)) {
            throw new Exception('not object');
        }
        $ref = new \ReflectionObject($object);
        $file = $ref->getFileName();
        $this->setPath($file);

        return $this;
    }
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()');
        }
    }