protected function mergeFileContent(string $pathAndFilename, array $configuration): array
    {
        if (!is_file($pathAndFilename)) {
            return $configuration;
        }

        try {
            $yaml = file_get_contents($pathAndFilename);
            if ($this->usePhpYamlExtension) {
                $loadedConfiguration = @yaml_parse($yaml);
                if ($loadedConfiguration === false) {
                    throw new ParseErrorException('A parse error occurred while parsing file "' . $pathAndFilename . '".', 1391894094);
                }
            } else {
                $loadedConfiguration = Yaml::parse($yaml);
            }
            unset($yaml);

            if (is_array($loadedConfiguration)) {
                $configuration = Arrays::arrayMergeRecursiveOverrule($configuration, $loadedConfiguration);
            }
        } catch (Exception $exception) {
            throw new ParseErrorException('A parse error occurred while parsing file "' . $pathAndFilename . '". Error message: ' . $exception->getMessage(), 1232014321);
        }

        return $configuration;
    }
protected function mergeFileContent(string $pathAndFilename, array $configuration): array
    {
        if (!is_file($pathAndFilename)) {
            return $configuration;
        }

        try {
            $yaml = file_get_contents($pathAndFilename);
            if ($this->usePhpYamlExtension) {
                $loadedConfiguration = @yaml_parse($yaml);
                if ($loadedConfiguration === false) {
                    throw new ParseErrorException('A parse error occurred while parsing file "' . $pathAndFilename . '".', 1391894094);
                }
            } else {
                $loadedConfiguration = Yaml::parse($yaml);
            }
            unset($yaml);

            if (is_array($loadedConfiguration)) {
                $configuration = Arrays::arrayMergeRecursiveOverrule($configuration, $loadedConfiguration);
            }
        } catch (Exception $exception) {
            throw new ParseErrorException('A parse error occurred while parsing file "' . $pathAndFilename . '". Error message: ' . $exception->getMessage(), 1232014321);
        }

        return $configuration;
    }
protected function mergeFileContent ( string $ pathAndFilename , array $ configuration ) : array { if ( ! is_file ( $ pathAndFilename ) ) { return $ configuration ; } try { $ yaml = file_get_contents ( $ pathAndFilename ) ; if ( $ this -> usePhpYamlExtension ) { $ loadedConfiguration = @ yaml_parse ( $ yaml ) ; if ( $ loadedConfiguration === false ) { throw new ParseErrorException ( 'A parse error occurred while parsing file "' . $ pathAndFilename . '".' , 1391894094 ) ; } } else { $ loadedConfiguration = Yaml :: parse ( $ yaml ) ; } unset ( $ yaml ) ; if ( is_array ( $ loadedConfiguration ) ) { $ configuration = Arrays :: arrayMergeRecursiveOverrule ( $ configuration , $ loadedConfiguration ) ; } } catch ( Exception $ exception ) { throw new ParseErrorException ( 'A parse error occurred while parsing file "' . $ pathAndFilename . '". Error message: ' . $ exception -> getMessage ( ) , 1232014321 ) ; } return $ configuration ; }
Loads the file with the given path and merge it's contents into the configuration array.

@param string $pathAndFilename
@param array $configuration
@return array
@throws ParseErrorException
Loads the file with the given path and merge it s contents into the configuration array .