Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ascii_by_languages.php #107

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update ascii_by_languages.php
Fixed Hindi
prakhardubey2002 authored Nov 20, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 51e889ecfea6ff3c09c0bf5c0fbd86d9ed308490
11 changes: 6 additions & 5 deletions src/voku/helper/data/ascii_by_languages.php
Original file line number Diff line number Diff line change
@@ -575,16 +575,17 @@
'ष' => 'Shha',
'ट' => 'Ta',
'त' => 'Ta',
'ठ' => 'Tha',
'ठ' => 'Th',
'द' => 'Tha',
'थ' => 'Tha',
'ध' => 'Thha',
'ड़' => 'ugDha',
'ढ़' => 'ugDhha',
'थ' => 'Th',
'ध' => 'dha',
'ड़' => 'da',
'ढ़' => 'dha',
'व' => 'Va',
'य' => 'Ya',
'य़' => 'Yi',
'ज़' => 'Za',
'ॐ' => 'om',
],
// Armenian
'hy' => [

Unchanged files with check annotations Beta

*
* @var string
*/
private static $REGEX_ASCII = "[^\x09\x10\x13\x0A\x0D\x20-\x7E]";

Check failure on line 184 in src/voku/helper/ASCII.php

GitHub Actions / tests (7.4, basic)

@readonly property cannot have a default value.
/**
* bidirectional text chars
*
* @var array<int, string>
*/
private static $BIDI_UNI_CODE_CONTROLS_TABLE = [

Check failure on line 193 in src/voku/helper/ASCII.php

GitHub Actions / tests (7.4, basic)

@readonly property cannot have a default value.
// LEFT-TO-RIGHT EMBEDDING (use -> dir = "ltr")
8234 => "\xE2\x80\xAA",
// RIGHT-TO-LEFT EMBEDDING (use -> dir = "rtl")
public static function charsArray(bool $replace_extra_symbols = false): array
{
if ($replace_extra_symbols) {
self::prepareAsciiAndExtrasMaps();

Check failure on line 262 in src/voku/helper/ASCII.php

GitHub Actions / tests (7.4, basic)

Impure call to method voku\helper\ASCII::prepareAsciiAndExtrasMaps() in pure method voku\helper\ASCII::charsArray().
return self::$ASCII_MAPS_AND_EXTRAS ?? [];
}
self::prepareAsciiMaps();

Check failure on line 267 in src/voku/helper/ASCII.php

GitHub Actions / tests (7.4, basic)

Impure call to method voku\helper\ASCII::prepareAsciiMaps() in pure method voku\helper\ASCII::charsArray().
return self::$ASCII_MAPS ?? [];
}
public static function charsArrayWithMultiLanguageValues(bool $replace_extra_symbols = false): array
{
/** @var array<string, array<string, array<int, string>>> */
static $CHARS_ARRAY = [];

Check failure on line 292 in src/voku/helper/ASCII.php

GitHub Actions / tests (7.4, basic)

Impure static variable in pure method voku\helper\ASCII::charsArrayWithMultiLanguageValues().
$cacheKey = '' . $replace_extra_symbols;
if (isset($CHARS_ARRAY[$cacheKey])) {
// init
/** @var array<string, array<string, array<string, string>|array{orig: string[], replace: string[]}>> */
static $CHARS_ARRAY = [];

Check failure on line 358 in src/voku/helper/ASCII.php

GitHub Actions / tests (7.4, basic)

Impure static variable in pure method voku\helper\ASCII::charsArrayWithOneLanguage().
$cacheKey = '' . $replace_extra_symbols . '-' . $asOrigReplaceArray;
// check static cache
}
if ($replace_extra_symbols) {
self::prepareAsciiAndExtrasMaps();

Check failure on line 367 in src/voku/helper/ASCII.php

GitHub Actions / tests (7.4, basic)

Impure call to method voku\helper\ASCII::prepareAsciiAndExtrasMaps() in pure method voku\helper\ASCII::charsArrayWithOneLanguage().
/** @noinspection DuplicatedCode */
if (isset(self::$ASCII_MAPS_AND_EXTRAS[$language])) {
}
}
} else {
self::prepareAsciiMaps();

Check failure on line 393 in src/voku/helper/ASCII.php

GitHub Actions / tests (7.4, basic)

Impure call to method voku\helper\ASCII::prepareAsciiMaps() in pure method voku\helper\ASCII::charsArrayWithOneLanguage().
/** @noinspection DuplicatedCode */
if (isset(self::$ASCII_MAPS[$language])) {
): array {
// init
/** @var array<string, array<string, string>|array{orig: string[], replace: string[]}> */
static $CHARS_ARRAY = [];

Check failure on line 449 in src/voku/helper/ASCII.php

GitHub Actions / tests (7.4, basic)

Impure static variable in pure method voku\helper\ASCII::charsArrayWithSingleLanguageValues().
$cacheKey = '' . $replace_extra_symbols . '-' . $asOrigReplaceArray;
if (isset($CHARS_ARRAY[$cacheKey])) {
}
if ($replace_extra_symbols) {
self::prepareAsciiAndExtrasMaps();

Check failure on line 457 in src/voku/helper/ASCII.php

GitHub Actions / tests (7.4, basic)

Impure call to method voku\helper\ASCII::prepareAsciiAndExtrasMaps() in pure method voku\helper\ASCII::charsArrayWithSingleLanguageValues().
/** @noinspection AlterInForeachInspection */
/** @psalm-suppress PossiblyNullIterator - we use the prepare* methods here, so we don't get NULL here */