private function loadYamlFile($path)
    {
        if (!class_exists('Symfony\Component\Yaml\Parser')) {
            throw new LogicException('YAML format requires the Symfony YAML component');
        }

        try {
            $yaml = new YamlParser();
            $data = $yaml->parseFile($path);
        } catch (Exception $e) {
            $message = sprintf('YAML file "%s" could not be parsed: %s', $path, $e->getMessage());
            throw new UnexpectedValueException($message, 0, $e);
        }

        if (!is_array($data)) {
            return [];
        }

        return $data;
    }
private function loadYamlFile($path)
    {
        if (!class_exists('Symfony\Component\Yaml\Parser')) {
            throw new LogicException('YAML format requires the Symfony YAML component');
        }

        try {
            $yaml = new YamlParser();
            $data = $yaml->parseFile($path);
        } catch (Exception $e) {
            $message = sprintf('YAML file "%s" could not be parsed: %s', $path, $e->getMessage());
            throw new UnexpectedValueException($message, 0, $e);
        }

        if (!is_array($data)) {
            return [];
        }

        return $data;
    }
private function loadYamlFile ( $ path ) { if ( ! class_exists ( 'Symfony\Component\Yaml\Parser' ) ) { throw new LogicException ( 'YAML format requires the Symfony YAML component' ) ; } try { $ yaml = new YamlParser ( ) ; $ data = $ yaml -> parseFile ( $ path ) ; } catch ( Exception $ e ) { $ message = sprintf ( 'YAML file "%s" could not be parsed: %s' , $ path , $ e -> getMessage ( ) ) ; throw new UnexpectedValueException ( $ message , 0 , $ e ) ; } if ( ! is_array ( $ data ) ) { return [ ] ; } return $ data ; }
Load a YAML file as an array.

@param  string $path A path to a YAML/YML file.
@throws LogicException If a YAML parser is unavailable.
@throws UnexpectedValueException If the file can not correctly be parsed into an array.
@return array An array on success.
If the file is parsed as any other type, an empty array is returned.
Load a YAML file as an array .