Lines Matching refs:self

148 …public static function idn_to_ascii($domainName, $options = self::IDNA_DEFAULT, $variant = self::I…
150 if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) {
156 …'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & self::IDNA_CHECK_BID…
157 …'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & self::IDNA_CHECK…
158 'UseSTD3ASCIIRules' => 0 !== ($options & self::IDNA_USE_STD3_RULES),
159 …'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & self::…
163 $labels = self::process((string) $domainName, $options, $info);
169 $label = 'xn--'.self::punycodeEncode($label);
171 $info->errors |= self::ERROR_PUNYCODE;
179 self::validateDomainAndLabelLength($labels, $info);
201 …public static function idn_to_utf8($domainName, $options = self::IDNA_DEFAULT, $variant = self::IN…
203 if (\PHP_VERSION_ID >= 70200 && self::INTL_IDNA_VARIANT_2003 === $variant) {
208 $labels = self::process((string) $domainName, [
210 …'CheckBidi' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 !== ($options & self::IDNA_CHECK_BID…
211 …'CheckJoiners' => self::INTL_IDNA_VARIANT_UTS46 === $variant && 0 !== ($options & self::IDNA_CHECK…
212 'UseSTD3ASCIIRules' => 0 !== ($options & self::IDNA_USE_STD3_RULES),
213 …'Transitional_Processing' => self::INTL_IDNA_VARIANT_2003 === $variant || 0 === ($options & self::…
231 if (!isset(self::$virama)) {
232self::$virama = require __DIR__.\DIRECTORY_SEPARATOR.'Resources'.\DIRECTORY_SEPARATOR.'unidata'.\D…
247 if (isset(self::$virama[$codePoints[$i - 1]])) {
280 foreach (self::utf8Decode($input) as $codePoint) {
281 $data = self::lookupCodePointStatus($codePoint, $useSTD3ASCIIRules);
285 $info->errors |= self::ERROR_DISALLOWED;
329 $info->errors |= self::ERROR_EMPTY_LABEL;
335 $domain = self::mapCodePoints($domain, $options, $info);
352 $label = self::punycodeDecode(substr($label, 4));
354 $info->errors |= self::ERROR_PUNYCODE;
363self::validateLabel($label, $info, $validationOptions, $i > 0 && $i === $lastLabelIndex);
367 $info->errors |= self::ERROR_BIDI;
452 $maxDomainSize = self::MAX_DOMAIN_SIZE;
471 if ($bytes > self::MAX_LABEL_SIZE) {
472 $info->errors |= self::ERROR_LABEL_TOO_LONG;
477 $info->errors |= self::ERROR_DOMAIN_NAME_TOO_LONG;
492 $info->errors |= self::ERROR_EMPTY_LABEL;
500 $info->errors |= self::ERROR_INVALID_ACE_LABEL;
503 $codePoints = self::utf8Decode($label);
509 $info->errors |= self::ERROR_HYPHEN_3_4;
515 $info->errors |= self::ERROR_LEADING_HYPHEN;
519 $info->errors |= self::ERROR_TRAILING_HYPHEN;
525 $info->errors |= self::ERROR_LABEL_HAS_DOT;
530 $info->errors |= self::ERROR_LEADING_COMBINING_MARK;
539 $data = self::lookupCodePointStatus($codePoint, $useSTD3ASCIIRules);
546 $info->errors |= self::ERROR_DISALLOWED;
554 if ($options['CheckJoiners'] && !self::isValidContextJ($codePoints, $label)) {
555 $info->errors |= self::ERROR_CONTEXTJ;
561 self::validateBidiLabel($label, $info);
574 $n = self::INITIAL_N;
577 $bias = self::INITIAL_BIAS;
578 $lastDelimIndex = strrpos($input, self::DELIMITER);
600 for ($k = self::BASE; /* no condition */; $k += self::BASE) {
605 $digit = self::$basicToDigit[$bytes[$in++] & 0xFF];
611 if ($digit > intdiv(self::MAX_INT - $i, $w)) {
618 $t = self::TMIN;
619 } elseif ($k >= $bias + self::TMAX) {
620 $t = self::TMAX;
629 $baseMinusT = self::BASE - $t;
631 if ($w > intdiv(self::MAX_INT, $baseMinusT)) {
639 $bias = self::adaptBias($i - $oldi, $outPlusOne, 0 === $oldi);
641 if (intdiv($i, $outPlusOne) > self::MAX_INT - $n) {
662 $n = self::INITIAL_N;
665 $bias = self::INITIAL_BIAS;
668 $iter = self::utf8Decode($input);
683 $output .= self::DELIMITER;
688 $m = self::MAX_INT;
696 if ($m - $n > intdiv(self::MAX_INT - $delta, $h + 1)) {
711 for ($k = self::BASE; /* no condition */; $k += self::BASE) {
713 $t = self::TMIN;
714 } elseif ($k >= $bias + self::TMAX) {
715 $t = self::TMAX;
725 $baseMinusT = self::BASE - $t;
726 $output .= self::encodeDigit($t + ($qMinusT) % ($baseMinusT), false);
731 $output .= self::encodeDigit($q, false);
733 $bias = self::adaptBias($delta, $h + 1, $h === $b);
758 $delta = $firstTime ? intdiv($delta, self::DAMP) : $delta >> 1;
762 while ($delta > ((self::BASE - self::TMIN) * self::TMAX) >> 1) {
763 $delta = intdiv($delta, self::BASE - self::TMIN);
764 $k += self::BASE;
767 return $k + intdiv((self::BASE - self::TMIN + 1) * $delta, $delta + self::SKEW);
881 if (!self::$mappingTableLoaded) {
882 self::$mappingTableLoaded = true;
883 self::$mapped = require __DIR__.'/Resources/unidata/mapped.php';
884 self::$ignored = require __DIR__.'/Resources/unidata/ignored.php';
885 self::$deviation = require __DIR__.'/Resources/unidata/deviation.php';
886 self::$disallowed = require __DIR__.'/Resources/unidata/disallowed.php';
887self::$disallowed_STD3_mapped = require __DIR__.'/Resources/unidata/disallowed_STD3_mapped.php';
888self::$disallowed_STD3_valid = require __DIR__.'/Resources/unidata/disallowed_STD3_valid.php';
891 if (isset(self::$mapped[$codePoint])) {
892 return ['status' => 'mapped', 'mapping' => self::$mapped[$codePoint]];
895 if (isset(self::$ignored[$codePoint])) {
899 if (isset(self::$deviation[$codePoint])) {
900 return ['status' => 'deviation', 'mapping' => self::$deviation[$codePoint]];
903 if (isset(self::$disallowed[$codePoint]) || DisallowedRanges::inRange($codePoint)) {
907 $isDisallowedMapped = isset(self::$disallowed_STD3_mapped[$codePoint]);
909 if ($isDisallowedMapped || isset(self::$disallowed_STD3_valid[$codePoint])) {
917 … return ['status' => $status, 'mapping' => self::$disallowed_STD3_mapped[$codePoint]];