protected function checkIfMultiInSetOrEmpty(
        $fieldName,
        $canUseFlexforms,
        $sheet,
        $explanation,
        array $allowedValues
    ) {
        if ($this->objectToCheck->hasConfValueString($fieldName, $sheet)) {
            $allValues = GeneralUtility::trimExplode(
                ',',
                $this->objectToCheck->getConfValueString($fieldName, $sheet),
                true
            );

            $overviewOfValues = '(' . implode(', ', $allowedValues) . ')';
            foreach ($allValues as $currentValue) {
                if (!in_array($currentValue, $allowedValues, true)) {
                    $message = 'The TS setup variable <strong>'
                        . $this->getTSSetupPath() . $fieldName
                        . '</strong> contains the value <strong>'
                        . htmlspecialchars($currentValue) . '</strong>, '
                        . 'but only the following values are allowed: '
                        . '<br /><strong>' . $overviewOfValues . '</strong><br />'
                        . $explanation;
                    $this->setErrorMessageAndRequestCorrection(
                        $fieldName,
                        $canUseFlexforms,
                        $message
                    );
                }
            }
        }
    }