if ($checkForEmptyLabels && '' ===
$domain) { $info->errors |= self::ERROR_EMPTY_LABEL;
return [$domain];
} // Step 1. Map each code point in the domain name string
$domain = self::
mapCodePoints($domain,
$options,
$info);
// Step 2. Normalize the domain name string to Unicode Normalization Form C.
if (!Normalizer::
isNormalized($domain, Normalizer::FORM_C
)) { $domain = Normalizer::
normalize($domain, Normalizer::FORM_C
);
} // Step 3. Break the string into labels at U+002E (.) FULL STOP.
$labels =
explode('.',
$domain);
$lastLabelIndex = \
count($labels) - 1;
// Step 4. Convert and validate each label in the domain name string.
foreach ($labels as $i =>
$label) { $validationOptions =
$options;