protected function parseConfigYaml($filename, $path = null)
{
// Initialise parser
if ($this->yamlParser === false) {
$this->yamlParser = new Parser();
}
// By default we assume that config files are located in app/config/
$path = $path ?: $this->app['resources']->getPath('config');
$filename = $path . '/' . $filename;
if (!is_readable($filename)) {
return [];
}
$yml = $this->yamlParser->parse(file_get_contents($filename) . "\n");
// Unset the repeated nodes key after parse
unset($yml['__nodes']);
// Invalid, non-existing, or empty files return NULL
return $yml ?: [];
}