protected function getCleanAdditionalConfiguration($extensionKey)
    {
        $newLines = [];

        // Load content and search for the include
        if (($content = GeneralUtility::getUrl($this->getConfigurationManager()->getAdditionalConfigurationFileLocation())) !== false)
        {
            $currentLines = explode(LF, $content);

            // Delete the php marker line
            array_shift($currentLines);

            //
            $startFound = false;
            $endFound = false;

            foreach ($currentLines as $line)
            {
                if (($startFound) && (!$endFound)) {
                    $endFound = (strpos($line, '}') !== false);
                } elseif ((!$startFound) && (strpos($line, $extensionKey) !== false)) {
                    $startFound = true;
                    $endFound = false;
                } else {
                    $newLines[] = $line;
                }
            }
        }

        // Remove blank lines at the end
        $revLines = array_reverse($newLines);
        $newLines = [];
        $lineFound = false;

        foreach ($revLines as $line)
        {
            if ($lineFound || !empty(trim($line))) {
                $newLines[] = $line;
                $lineFound = true;
            }
        }

        return array_reverse($newLines);
    }