protected function mergeExternalFiles(string $file, MutableBag $envs): MutableBag
    {
        $extPos = strrpos($file, '.');
        $pathTemplate = substr_replace($file, '.%s.', $extPos, 1);
        foreach ($envs as $name => $config) {
            // config.yml -> config.production.yml
            $envFile = sprintf($pathTemplate, $name);
            if (!is_readable($envFile)) {
                continue;
            }
            $envConfig = $this->parse($envFile);
            $envs[$name] = $config->replaceRecursive($envConfig);
        }

        return $envs;
    }
protected function mergeExternalFiles(string $file, MutableBag $envs): MutableBag
    {
        $extPos = strrpos($file, '.');
        $pathTemplate = substr_replace($file, '.%s.', $extPos, 1);
        foreach ($envs as $name => $config) {
            // config.yml -> config.production.yml
            $envFile = sprintf($pathTemplate, $name);
            if (!is_readable($envFile)) {
                continue;
            }
            $envConfig = $this->parse($envFile);
            $envs[$name] = $config->replaceRecursive($envConfig);
        }

        return $envs;
    }
protected function mergeExternalFiles ( string $ file , MutableBag $ envs ) : MutableBag { $ extPos = strrpos ( $ file , '.' ) ; $ pathTemplate = substr_replace ( $ file , '.%s.' , $ extPos , 1 ) ; foreach ( $ envs as $ name => $ config ) { // config.yml -> config.production.yml $ envFile = sprintf ( $ pathTemplate , $ name ) ; if ( ! is_readable ( $ envFile ) ) { continue ; } $ envConfig = $ this -> parse ( $ envFile ) ; $ envs [ $ name ] = $ config -> replaceRecursive ( $ envConfig ) ; } return $ envs ; }
Merge in separate environment specific files.

@param string                  $file
@param MutableBag|MutableBag[] $envs

@return MutableBag|MutableBag[]
Merge in separate environment specific files .