Skip to content

Commit 1a03b5b

Browse files
committed
Merge branch '5.3' into 5.4
* 5.3: [HttpClient] Fix handling thrown \Exception in \Generator in MockResponse [DebugBundle] Add missing README [String] Fix requiring wcswitch table several times
2 parents 9ffaaba + 47bc56d commit 1a03b5b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

AbstractUnicodeString.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ abstract class AbstractUnicodeString extends AbstractString
4949
private const TRANSLIT_TO = ['AE', 'D', 'O', 'TH', 'ss', 'ae', 'd', 'o', 'th', 'D', 'd', 'H', 'h', 'i', 'q', 'L', 'l', 'L', 'l', '\'n', 'N', 'n', 'OE', 'oe', 'T', 't', 'b', 'B', 'B', 'b', 'C', 'c', 'D', 'D', 'D', 'd', 'E', 'F', 'f', 'G', 'hv', 'I', 'I', 'K', 'k', 'l', 'N', 'n', 'OI', 'oi', 'P', 'p', 't', 'T', 't', 'T', 'V', 'Y', 'y', 'Z', 'z', 'DZ', 'Dz', 'dz', 'G', 'g', 'd', 'Z', 'z', 'l', 'n', 't', 'j', 'db', 'qp', 'A', 'C', 'c', 'L', 'T', 's', 'z', 'B', 'U', 'E', 'e', 'J', 'j', 'R', 'r', 'Y', 'y', 'b', 'c', 'd', 'd', 'e', 'j', 'g', 'g', 'G', 'h', 'h', 'i', 'I', 'l', 'l', 'l', 'm', 'n', 'n', 'N', 'OE', 'r', 'r', 'r', 'R', 's', 't', 'u', 'v', 'Y', 'z', 'z', 'B', 'G', 'H', 'j', 'L', 'q', 'dz', 'dz', 'ts', 'ls', 'lz', 'A', 'AE', 'B', 'C', 'D', 'D', 'E', 'J', 'K', 'L', 'M', 'O', 'P', 'T', 'U', 'V', 'W', 'Z', 'ue', 'b', 'd', 'f', 'm', 'n', 'p', 'r', 'r', 's', 't', 'z', 'th', 'I', 'p', 'U', 'b', 'd', 'f', 'g', 'k', 'l', 'm', 'n', 'p', 'r', 's', 'v', 'x', 'z', 'a', 'd', 'e', 'e', 'i', 'u', 'a', 's', 's', 'SS', 'LL', 'll', 'V', 'v', 'Y', 'y', '(C)', '(R)', 'CE', 'Cr', 'Fr.', 'L.', 'Pts', 'TL', 'Rs', 'x', 'Rx', 'm/s', 'rad/s', 'C/kg', 'pH', 'V/m', 'A/m', ' 1/4', ' 1/2', ' 3/4', ' 1/3', ' 2/3', ' 1/5', ' 2/5', ' 3/5', ' 4/5', ' 1/6', ' 5/6', ' 1/8', ' 3/8', ' 5/8', ' 7/8', ' 1/', '0', '\'', '\'', ',', '\'', '"', '"', ',,', '"', '\'', '"', '"', '"', '<<', '>>', '<', '>', '-', '-', '-', '-', '-', '-', '-', '-', '-', '||', '/', '[', ']', '*', ',', '.', '<', '>', '<<', '>>', '[', ']', '[', ']', '[', ']', ',', '.', '[', ']', '<<', '>>', '<', '>', ',', '[', ']', '((', '))', '.', ',', '*', '/', '-', '/', '\\', '|', '||', '<<', '>>', '((', '))'];
5050

5151
private static $transliterators = [];
52+
private static $tableZero;
53+
private static $tableWide;
5254

5355
/**
5456
* @return static
@@ -570,39 +572,37 @@ private function wcswidth(string $string): int
570572
return -1;
571573
}
572574

573-
static $tableZero;
574-
if (null === $tableZero) {
575-
$tableZero = require __DIR__.'/Resources/data/wcswidth_table_zero.php';
575+
if (null === self::$tableZero) {
576+
self::$tableZero = require __DIR__.'/Resources/data/wcswidth_table_zero.php';
576577
}
577578

578-
if ($codePoint >= $tableZero[0][0] && $codePoint <= $tableZero[$ubound = \count($tableZero) - 1][1]) {
579+
if ($codePoint >= self::$tableZero[0][0] && $codePoint <= self::$tableZero[$ubound = \count(self::$tableZero) - 1][1]) {
579580
$lbound = 0;
580581
while ($ubound >= $lbound) {
581582
$mid = floor(($lbound + $ubound) / 2);
582583

583-
if ($codePoint > $tableZero[$mid][1]) {
584+
if ($codePoint > self::$tableZero[$mid][1]) {
584585
$lbound = $mid + 1;
585-
} elseif ($codePoint < $tableZero[$mid][0]) {
586+
} elseif ($codePoint < self::$tableZero[$mid][0]) {
586587
$ubound = $mid - 1;
587588
} else {
588589
continue 2;
589590
}
590591
}
591592
}
592593

593-
static $tableWide;
594-
if (null === $tableWide) {
595-
$tableWide = require __DIR__.'/Resources/data/wcswidth_table_wide.php';
594+
if (null === self::$tableWide) {
595+
self::$tableWide = require __DIR__.'/Resources/data/wcswidth_table_wide.php';
596596
}
597597

598-
if ($codePoint >= $tableWide[0][0] && $codePoint <= $tableWide[$ubound = \count($tableWide) - 1][1]) {
598+
if ($codePoint >= self::$tableWide[0][0] && $codePoint <= self::$tableWide[$ubound = \count(self::$tableWide) - 1][1]) {
599599
$lbound = 0;
600600
while ($ubound >= $lbound) {
601601
$mid = floor(($lbound + $ubound) / 2);
602602

603-
if ($codePoint > $tableWide[$mid][1]) {
603+
if ($codePoint > self::$tableWide[$mid][1]) {
604604
$lbound = $mid + 1;
605-
} elseif ($codePoint < $tableWide[$mid][0]) {
605+
} elseif ($codePoint < self::$tableWide[$mid][0]) {
606606
$ubound = $mid - 1;
607607
} else {
608608
$width += 2;

0 commit comments

Comments
 (0)