protected function loadTypoScript()
{
$mergedTypoScriptCode = '';
$typoScriptPathPatterns = $this->getOption('typoScriptPathPatterns');
ksort($typoScriptPathPatterns);
foreach ($typoScriptPathPatterns as $typoScriptPathPattern) {
$typoScriptPathPattern = str_replace('@package', $this->getPackageKey(), $typoScriptPathPattern);
$filePaths = array_merge(Files::readDirectoryRecursively($typoScriptPathPattern, '.fusion'), Files::readDirectoryRecursively($typoScriptPathPattern, '.ts2'));
sort($filePaths);
foreach ($filePaths as $filePath) {
$mergedTypoScriptCode .= PHP_EOL . file_get_contents($filePath) . PHP_EOL;
}
}
$this->parsedTypoScript = $this->typoScriptParser->parse($mergedTypoScriptCode);
}