protected function checkbidi($codepoints)
{
if (!count($codepoints)) {
return;
}
$RALmode = !RFC3454\D_1::filter(reset($codepoints));
if ($RALmode) {
if (RFC3454\D_1::filter($codepoints[count($codepoints) - 1])) {
throw new ProfileException('Invalid bidirectional text');
}
// Ensure that there are'nt any L characters in this string.
array_walk($codepoints, 'static::validateCodepoint', 'Znerol\\Component\\Stringprep\\RFC3454\\D_2::filter');
} else {
// Ensure that there are'nt any R/AL characters in this string.
array_walk($codepoints, 'static::validateCodepoint', 'Znerol\\Component\\Stringprep\\RFC3454\\D_1::filter');
}
}