protected static function getConfFromContents($contents, $filename = '(.yml)')
    {
        if (self::$params) {
            $template = new Template($contents, '%', '%');
            $template->setVars(self::$params);
            $contents = $template->produce();
        }

        try {
            return Yaml::parse($contents);
        } catch (ParseException $exception) {
            throw new ConfigurationException(
                sprintf(
                    "Error loading Yaml config from `%s`\n \n%s\nRead more about Yaml format https://goo.gl/9UPuEC",
                    $filename,
                    $exception->getMessage()
                )
            );
        }
    }
protected static function getConfFromContents($contents, $filename = '(.yml)')
    {
        if (self::$params) {
            $template = new Template($contents, '%', '%');
            $template->setVars(self::$params);
            $contents = $template->produce();
        }

        try {
            return Yaml::parse($contents);
        } catch (ParseException $exception) {
            throw new ConfigurationException(
                sprintf(
                    "Error loading Yaml config from `%s`\n \n%s\nRead more about Yaml format https://goo.gl/9UPuEC",
                    $filename,
                    $exception->getMessage()
                )
            );
        }
    }
protected static function getConfFromContents ( $ contents , $ filename = '(.yml)' ) { if ( self :: $ params ) { $ template = new Template ( $ contents , '%' , '%' ) ; $ template -> setVars ( self :: $ params ) ; $ contents = $ template -> produce ( ) ; } try { return Yaml :: parse ( $ contents ) ; } catch ( ParseException $ exception ) { throw new ConfigurationException ( sprintf ( "Error loading Yaml config from `%s`\n \n%s\nRead more about Yaml format https://goo.gl/9UPuEC" , $ filename , $ exception -> getMessage ( ) ) ) ; } }
Loads configuration from Yaml data

@param string $contents Yaml config file contents
@param string $filename which is supposed to be loaded
@return array
@throws ConfigurationException
Loads configuration from Yaml data