public static function extractTypoScriptKeyForPidAndType($id, $typeNum, $key)
    {
        $key = trim($key);
        if (!strlen($key)) {
            throw new \RuntimeException(sprintf('Invalid TypoScript key "%s"', $key), 1481365294);
        }

        // Get a frontend controller for the page id and type
        $TSFE = self::getTSFE($id, $typeNum);
        list($name, $conf) = GeneralUtility::makeInstance(TypoScriptParser::class)->getVal($key, $TSFE->tmpl->setup);
        $lastKey = explode('.', $key);
        $lastKey = array_pop($lastKey);

        return [$lastKey => $name, $lastKey.'.' => $conf];
    }