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;
    }