Raml\Parser::parseRamlString PHP Method

parseRamlString() private method

Parse a RAML or YAML content
private parseRamlString ( string $ramlString, string $rootDir ) : array
$ramlString string
$rootDir string
return array
    private function parseRamlString($ramlString, $rootDir)
    {
        // get the header
        $header = strtok($ramlString, "\n");
        $data = $this->parseYaml($ramlString);
        if (!$data) {
            throw new \Exception('RAML file appears to be empty');
        }
        if (strpos($header, '#%RAML') === 0) {
            // @todo extract the vesion of the raml and do something with it
            $data = $this->includeAndParseFiles($data, $rootDir);
        }
        return $data;
    }