Raml\Parser::includeAndParseFiles PHP Method

includeAndParseFiles() private method

Recurse through the structure and load includes
private includeAndParseFiles ( array | string $structure, string $rootDir ) : array
$structure array | string
$rootDir string
return array
    private function includeAndParseFiles($structure, $rootDir)
    {
        if (is_array($structure)) {
            $result = array();
            foreach ($structure as $key => $structureElement) {
                $result[$key] = $this->includeAndParseFiles($structureElement, $rootDir);
            }
            return $result;
        } elseif (strpos($structure, '!include') === 0) {
            return $this->loadAndParseFile(str_replace('!include ', '', $structure), $rootDir);
        } else {
            return $structure;
        }
    }