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