private function includeAndParseFiles($structure, $rootDir)
    {
        if (\is_array($structure)) {
            $result = [];
            foreach ($structure as $key => $structureElement) {
                $result[$key] = $this->includeAndParseFiles($structureElement, $rootDir);
            }

            return $result;
        }

        if ($structure instanceof TaggedValue && $structure->getTag() === 'include') {
            return $this->loadAndParseFile($structure->getValue(), $rootDir);
        }

        if (\strpos($structure, '!include') === 0) {
            return $this->loadAndParseFile(\str_replace('!include ', '', $structure), $rootDir);
        }

        return $structure;
    }
private function includeAndParseFiles($structure, $rootDir)
    {
        if (\is_array($structure)) {
            $result = [];
            foreach ($structure as $key => $structureElement) {
                $result[$key] = $this->includeAndParseFiles($structureElement, $rootDir);
            }

            return $result;
        }

        if ($structure instanceof TaggedValue && $structure->getTag() === 'include') {
            return $this->loadAndParseFile($structure->getValue(), $rootDir);
        }

        if (\strpos($structure, '!include') === 0) {
            return $this->loadAndParseFile(\str_replace('!include ', '', $structure), $rootDir);
        }

        return $structure;
    }
private function includeAndParseFiles ( $ structure , $ rootDir ) { if ( \ is_array ( $ structure ) ) { $ result = [ ] ; foreach ( $ structure as $ key => $ structureElement ) { $ result [ $ key ] = $ this -> includeAndParseFiles ( $ structureElement , $ rootDir ) ; } return $ result ; } if ( $ structure instanceof TaggedValue && $ structure -> getTag ( ) === 'include' ) { return $ this -> loadAndParseFile ( $ structure -> getValue ( ) , $ rootDir ) ; } if ( \ strpos ( $ structure , '!include' ) === 0 ) { return $ this -> loadAndParseFile ( \ str_replace ( '!include ' , '' , $ structure ) , $ rootDir ) ; } return $ structure ; }
Recurse through the structure and load includes

@param array|string|TaggedValue $structure
@param string $rootDir
@return array|string|TaggedValue
Recurse through the structure and load includes