Skip to content

Commit

Permalink
Makes Unicode data files compliant with our coding standard
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Stovell <[email protected]>
  • Loading branch information
Sesquipedalian committed Nov 21, 2023
1 parent e8489b7 commit 8f94ae6
Show file tree
Hide file tree
Showing 15 changed files with 7,283 additions and 7,273 deletions.
4 changes: 0 additions & 4 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@
'random_compat',
'ReCaptcha',
])
// Work with PHP files.
->name('*.php')
// Skip all index.php files.
->notName('index.php')
// Skip Unicode data files, but not Utf8String.php.
->notPath('/Unicode\/(?!Utf8String).*\.php/')
// Skip anything being ignored in .gitignore.
->ignoreVCSIgnored(true);

Expand Down
11 changes: 6 additions & 5 deletions Sources/Unicode/CaseFold.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

namespace SMF\Unicode;

if (!defined('SMF'))
if (!defined('SMF')) {
die('No direct access...');
}

/**
* Helper function for utf8_casefold.
Expand All @@ -26,7 +27,7 @@
*/
function utf8_casefold_simple_maps()
{
return array(
return [
"\x41" => "\x61",
"\x42" => "\x62",
"\x43" => "\x63",
Expand Down Expand Up @@ -1484,7 +1485,7 @@ function utf8_casefold_simple_maps()
"\xF0\x9E\xA4\x9F" => "\xF0\x9E\xA5\x81",
"\xF0\x9E\xA4\xA0" => "\xF0\x9E\xA5\x82",
"\xF0\x9E\xA4\xA1" => "\xF0\x9E\xA5\x83",
);
];
}

/**
Expand All @@ -1497,7 +1498,7 @@ function utf8_casefold_simple_maps()
*/
function utf8_casefold_maps()
{
return array(
return [
"\x41" => "\x61",
"\x42" => "\x62",
"\x43" => "\x63",
Expand Down Expand Up @@ -3028,7 +3029,7 @@ function utf8_casefold_maps()
"\xF0\x9E\xA4\x9F" => "\xF0\x9E\xA5\x81",
"\xF0\x9E\xA4\xA0" => "\xF0\x9E\xA5\x82",
"\xF0\x9E\xA4\xA1" => "\xF0\x9E\xA5\x83",
);
];
}

?>
11 changes: 6 additions & 5 deletions Sources/Unicode/CaseLower.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

namespace SMF\Unicode;

if (!defined('SMF'))
if (!defined('SMF')) {
die('No direct access...');
}

/**
* Helper function for utf8_strtolower.
Expand All @@ -26,7 +27,7 @@
*/
function utf8_strtolower_simple_maps()
{
return array(
return [
"\x41" => "\x61",
"\x42" => "\x62",
"\x43" => "\x63",
Expand Down Expand Up @@ -1460,7 +1461,7 @@ function utf8_strtolower_simple_maps()
"\xF0\x9E\xA4\x9F" => "\xF0\x9E\xA5\x81",
"\xF0\x9E\xA4\xA0" => "\xF0\x9E\xA5\x82",
"\xF0\x9E\xA4\xA1" => "\xF0\x9E\xA5\x83",
);
];
}

/**
Expand All @@ -1473,7 +1474,7 @@ function utf8_strtolower_simple_maps()
*/
function utf8_strtolower_maps()
{
return array(
return [
"\x41" => "\x61",
"\x42" => "\x62",
"\x43" => "\x63",
Expand Down Expand Up @@ -2982,7 +2983,7 @@ function utf8_strtolower_maps()
"\xEF\xBC\xB8" => "\xEF\xBD\x98",
"\xEF\xBC\xB9" => "\xEF\xBD\x99",
"\xEF\xBC\xBA" => "\xEF\xBD\x9A",
);
];
}

?>
11 changes: 6 additions & 5 deletions Sources/Unicode/CaseTitle.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

namespace SMF\Unicode;

if (!defined('SMF'))
if (!defined('SMF')) {
die('No direct access...');
}

/**
* Helper function for utf8_convert_case.
Expand All @@ -26,7 +27,7 @@
*/
function utf8_titlecase_simple_maps()
{
return array(
return [
"\xC7\x84" => "\xC7\x85",
"\xC7\x85" => "\xC7\x85",
"\xC7\x86" => "\xC7\x85",
Expand Down Expand Up @@ -85,7 +86,7 @@ function utf8_titlecase_simple_maps()
"\xE1\x83\xBD" => "\xE1\x83\xBD",
"\xE1\x83\xBE" => "\xE1\x83\xBE",
"\xE1\x83\xBF" => "\xE1\x83\xBF",
);
];
}

/**
Expand All @@ -98,7 +99,7 @@ function utf8_titlecase_simple_maps()
*/
function utf8_titlecase_maps()
{
return array(
return [
"\xC3\x9F" => "\x53\x73",
"\xC7\x84" => "\xC7\x85",
"\xC7\x85" => "\xC7\x85",
Expand Down Expand Up @@ -234,7 +235,7 @@ function utf8_titlecase_maps()
"\xEF\xAC\x95" => "\xD5\x84\xD5\xAB",
"\xEF\xAC\x96" => "\xD5\x8E\xD5\xB6",
"\xEF\xAC\x97" => "\xD5\x84\xD5\xAD",
);
];
}

?>
11 changes: 6 additions & 5 deletions Sources/Unicode/CaseUpper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

namespace SMF\Unicode;

if (!defined('SMF'))
if (!defined('SMF')) {
die('No direct access...');
}

/**
* Helper function for utf8_strtoupper.
Expand All @@ -26,7 +27,7 @@
*/
function utf8_strtoupper_simple_maps()
{
return array(
return [
"\x61" => "\x41",
"\x62" => "\x42",
"\x63" => "\x43",
Expand Down Expand Up @@ -1477,7 +1478,7 @@ function utf8_strtoupper_simple_maps()
"\xF0\x9E\xA5\x81" => "\xF0\x9E\xA4\x9F",
"\xF0\x9E\xA5\x82" => "\xF0\x9E\xA4\xA0",
"\xF0\x9E\xA5\x83" => "\xF0\x9E\xA4\xA1",
);
];
}

/**
Expand All @@ -1490,7 +1491,7 @@ function utf8_strtoupper_simple_maps()
*/
function utf8_strtoupper_maps()
{
return array(
return [
"\x61" => "\x41",
"\x62" => "\x42",
"\x63" => "\x43",
Expand Down Expand Up @@ -3017,7 +3018,7 @@ function utf8_strtoupper_maps()
"\xEF\xBD\x98" => "\xEF\xBC\xB8",
"\xEF\xBD\x99" => "\xEF\xBC\xB9",
"\xEF\xBD\x9A" => "\xEF\xBC\xBA",
);
];
}

?>
7 changes: 4 additions & 3 deletions Sources/Unicode/CombiningClasses.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

namespace SMF\Unicode;

if (!defined('SMF'))
if (!defined('SMF')) {
die('No direct access...');
}

/**
* Helper function for utf8_normalize_d.
Expand All @@ -26,7 +27,7 @@
*/
function utf8_combining_classes()
{
return array(
return [
"\xCC\x80" => 230,
"\xCC\x81" => 230,
"\xCC\x82" => 230,
Expand Down Expand Up @@ -949,7 +950,7 @@ function utf8_combining_classes()
"\xF0\x9E\xA5\x88" => 230,
"\xF0\x9E\xA5\x89" => 230,
"\xF0\x9E\xA5\x8A" => 7,
);
];
}

?>
7 changes: 4 additions & 3 deletions Sources/Unicode/Composition.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

namespace SMF\Unicode;

if (!defined('SMF'))
if (!defined('SMF')) {
die('No direct access...');
}

/**
* Helper function for utf8_compose.
Expand All @@ -26,7 +27,7 @@
*/
function utf8_compose_maps()
{
return array(
return [
"\x41\xCC\x80" => "\xC3\x80",
"\x41\xCC\x81" => "\xC3\x81",
"\x41\xCC\x82" => "\xC3\x82",
Expand Down Expand Up @@ -968,7 +969,7 @@ function utf8_compose_maps()
"\xF0\x91\x96\xB8\xF0\x91\x96\xAF" => "\xF0\x91\x96\xBA",
"\xF0\x91\x96\xB9\xF0\x91\x96\xAF" => "\xF0\x91\x96\xBB",
"\xF0\x91\xA4\xB5\xF0\x91\xA4\xB0" => "\xF0\x91\xA4\xB8",
);
];
}

?>
7 changes: 4 additions & 3 deletions Sources/Unicode/DecompositionCanonical.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

namespace SMF\Unicode;

if (!defined('SMF'))
if (!defined('SMF')) {
die('No direct access...');
}

/**
* Helper function for utf8_normalize_d.
Expand All @@ -26,7 +27,7 @@
*/
function utf8_normalize_d_maps()
{
return array(
return [
"\xC3\x80" => "\x41\xCC\x80",
"\xC3\x81" => "\x41\xCC\x81",
"\xC3\x82" => "\x41\xCC\x82",
Expand Down Expand Up @@ -2088,7 +2089,7 @@ function utf8_normalize_d_maps()
"\xF0\xAF\xA8\x9B" => "\xE9\xBC\x96",
"\xF0\xAF\xA8\x9C" => "\xE9\xBC\xBB",
"\xF0\xAF\xA8\x9D" => "\xF0\xAA\x98\x80",
);
];
}

?>
7 changes: 4 additions & 3 deletions Sources/Unicode/DecompositionCompatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

namespace SMF\Unicode;

if (!defined('SMF'))
if (!defined('SMF')) {
die('No direct access...');
}

/**
* Helper function for utf8_normalize_kd.
Expand All @@ -26,7 +27,7 @@
*/
function utf8_normalize_kd_maps()
{
return array(
return [
"\xC2\xA0" => "\x20",
"\xC2\xA8" => "\x20\xCC\x88",
"\xC2\xAA" => "\x61",
Expand Down Expand Up @@ -3839,7 +3840,7 @@ function utf8_normalize_kd_maps()
"\xF0\x9F\xAF\xB7" => "\x37",
"\xF0\x9F\xAF\xB8" => "\x38",
"\xF0\x9F\xAF\xB9" => "\x39",
);
];
}

?>
7 changes: 4 additions & 3 deletions Sources/Unicode/DefaultIgnorables.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

namespace SMF\Unicode;

if (!defined('SMF'))
if (!defined('SMF')) {
die('No direct access...');
}

/**
* Helper function for utf8_normalize_kc_casefold.
Expand All @@ -26,7 +27,7 @@
*/
function utf8_default_ignorables()
{
return array(
return [
"\xC2\xAD",
"\xCD\x8F",
"\xD8\x9C",
Expand Down Expand Up @@ -4201,7 +4202,7 @@ function utf8_default_ignorables()
"\xF3\xA0\xBF\xBD",
"\xF3\xA0\xBF\xBE",
"\xF3\xA0\xBF\xBF",
);
];
}

?>
Loading

0 comments on commit 8f94ae6

Please sign in to comment.