From b39cb4321b7b963c881864b0389fa18390cfda39 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Tue, 7 Nov 2023 16:24:38 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Langs/Langs.php | 5 +-- src/Langs/Replaces.php | 78 ++++++++++++++++++------------------- src/Miscellaneous/Words.php | 10 ++--- src/SpellNumber.php | 10 ++--- src/Traits/Accesor.php | 4 +- src/Traits/Locale.php | 2 +- 6 files changed, 53 insertions(+), 56 deletions(-) diff --git a/src/Langs/Langs.php b/src/Langs/Langs.php index bea6111..fadfbfd 100644 --- a/src/Langs/Langs.php +++ b/src/Langs/Langs.php @@ -2,14 +2,12 @@ namespace Rmunate\Utilities\Langs; - use Rmunate\Utilities\Traits\Locale; -use Rmunate\Utilities\Miscellaneous\Utilities; final class Langs { use Locale; - + /** * List of time zones available in the package. * @@ -63,5 +61,4 @@ final class Langs 'pt' => 'de', // Portuguese from Portugal: "de" 'ro' => 'de', // Romanian from Romania: "de" ]; - } diff --git a/src/Langs/Replaces.php b/src/Langs/Replaces.php index ab61632..88617d4 100644 --- a/src/Langs/Replaces.php +++ b/src/Langs/Replaces.php @@ -20,49 +20,49 @@ final class Replaces 'illion' => 'illion Of', ], 'es' => [ - 'veintiuno' => 'veintiún', - 'treinta Y Uno' => 'treintaiún', - 'cuarenta y uno' => 'cuarentaiún', - 'cincuenta y uno' => 'cincuentaiún', - 'sesenta y uno' => 'sesentaiún', - 'setenta y uno' => 'setentaiún', - 'ochenta y uno' => 'ochentaiún', - 'noventa y uno' => 'noventaiún', - 'ciento uno' => 'ciento un', - 'doscientos uno' => 'doscientos un', - 'trescientos uno' => 'trescientos un', + 'veintiuno' => 'veintiún', + 'treinta Y Uno' => 'treintaiún', + 'cuarenta y uno' => 'cuarentaiún', + 'cincuenta y uno' => 'cincuentaiún', + 'sesenta y uno' => 'sesentaiún', + 'setenta y uno' => 'setentaiún', + 'ochenta y uno' => 'ochentaiún', + 'noventa y uno' => 'noventaiún', + 'ciento uno' => 'ciento un', + 'doscientos uno' => 'doscientos un', + 'trescientos uno' => 'trescientos un', 'cuatrocientos uno' => 'cuatrocientos un', - 'quinientos uno' => 'quinientos un', - 'seiscientos uno' => 'seiscientos un', - 'setecientos uno' => 'setecientos un', - 'ochocientos uno' => 'ochocientos un', - 'novecientos uno' => 'novecientos un', - 'mil uno' => 'mil un', - 'uno millón' => 'un millón', - 'illón' => 'illón De', - 'illones' => 'illones De', - 'uno pesos' => 'un peso', - 'uno soles' => 'un sol', - 'uno euros' => 'un euro', - 'uno bolívares' => 'un bolívar', - 'uno bolivares' => 'un bolívar', - 'uno quetzales' => 'un quetzal', - 'uno lempiras' => 'un lempira', - 'uno córdobas' => 'un córdoba', - 'uno cordobas' => 'un córdoba', - 'uno colónes' => 'un colón', - 'uno colones' => 'un colón', - 'uno balboas' => 'un balboa', - 'uno centavos' => 'un centavo', - 'uno céntimos' => 'un céntimo', - 'uno centimos' => 'un céntimo', - 'uno centimo' => 'un céntimo', + 'quinientos uno' => 'quinientos un', + 'seiscientos uno' => 'seiscientos un', + 'setecientos uno' => 'setecientos un', + 'ochocientos uno' => 'ochocientos un', + 'novecientos uno' => 'novecientos un', + 'mil uno' => 'mil un', + 'uno millón' => 'un millón', + 'illón' => 'illón De', + 'illones' => 'illones De', + 'uno pesos' => 'un peso', + 'uno soles' => 'un sol', + 'uno euros' => 'un euro', + 'uno bolívares' => 'un bolívar', + 'uno bolivares' => 'un bolívar', + 'uno quetzales' => 'un quetzal', + 'uno lempiras' => 'un lempira', + 'uno córdobas' => 'un córdoba', + 'uno cordobas' => 'un córdoba', + 'uno colónes' => 'un colón', + 'uno colones' => 'un colón', + 'uno balboas' => 'un balboa', + 'uno centavos' => 'un centavo', + 'uno céntimos' => 'un céntimo', + 'uno centimos' => 'un céntimo', + 'uno centimo' => 'un céntimo', ], 'fa' => [ 'ilion' => 'میلیون و', ], 'fr' => [ - 'illion' => 'illion De', + 'illion' => 'illion De', 'illions' => 'illions De', ], 'hi' => [ @@ -76,11 +76,11 @@ final class Replaces //... ], 'pt' => [ - 'ilhão' => 'ilhão De', + 'ilhão' => 'ilhão De', 'ilhões' => 'ilhões De', ], 'ro' => [ - 'ilion' => 'ilion De', + 'ilion' => 'ilion De', 'ilioane' => 'ilioane De', ], ]; diff --git a/src/Miscellaneous/Words.php b/src/Miscellaneous/Words.php index 744db56..9aea175 100644 --- a/src/Miscellaneous/Words.php +++ b/src/Miscellaneous/Words.php @@ -10,9 +10,9 @@ final class Words /** * Perform replacements in the given text based on the language and current currency. * - * @param string $value The original text string. - * @param string $locale The language of the text. - * @param string $type The method. + * @param string $value The original text string. + * @param string $locale The language of the text. + * @param string $type The method. * * @return string The adjusted text with the replacements performed. */ @@ -39,8 +39,8 @@ public static function replaceLocale(string $value, string $locale, string $type /** * Perform replacements in the given text based on the language and current currency from config file. * - * @param string $value The original text string. - * @param string $locale The language of the text. + * @param string $value The original text string. + * @param string $locale The language of the text. * * @return string The adjusted text with the replacements performed. */ diff --git a/src/SpellNumber.php b/src/SpellNumber.php index 0cf3baa..9a6fbfe 100644 --- a/src/SpellNumber.php +++ b/src/SpellNumber.php @@ -252,7 +252,7 @@ private function doubleToLetters() */ private function integerToMoney() { - $letters = NumberFormatterWrapper::format($this->value, $this->locale) . " " . $this->currency; + $letters = NumberFormatterWrapper::format($this->value, $this->locale).' '.$this->currency; $letters = Words::replaceLocale($letters, $this->locale, self::TO_MONEY); return Words::replaceFromConfig($letters, $this->locale); @@ -273,13 +273,13 @@ private function doubleToMoney() $parts[1] = Utilities::decimal($parts[1]); - $letters1 = NumberFormatterWrapper::format($parts[0], $this->locale) . " " . $this->currency; - $letters2 = NumberFormatterWrapper::format($parts[1], $this->locale) . " " . $this->fraction; - + $letters1 = NumberFormatterWrapper::format($parts[0], $this->locale).' '.$this->currency; + $letters2 = NumberFormatterWrapper::format($parts[1], $this->locale).' '.$this->fraction; + $output = $letters1.' '.Utilities::connector($this->locale).' '.$letters2; $output = Words::replaceLocale($output, $this->locale, self::TO_MONEY); - return Words::replaceFromConfig($output, $this->locale); + return Words::replaceFromConfig($output, $this->locale); } /** diff --git a/src/Traits/Accesor.php b/src/Traits/Accesor.php index 0b1c2bd..135e0da 100644 --- a/src/Traits/Accesor.php +++ b/src/Traits/Accesor.php @@ -3,7 +3,7 @@ namespace Rmunate\Utilities\Traits; /** - * Trait Accesor + * Trait Accesor. * * This trait provides a method to access constants of a class that uses it. */ @@ -19,6 +19,6 @@ trait Accesor public static function constant(string $name) { // Use the constant() function to access the constant. - return constant(get_called_class() . '::' . $name); + return constant(get_called_class().'::'.$name); } } diff --git a/src/Traits/Locale.php b/src/Traits/Locale.php index f7281c5..2e005cd 100644 --- a/src/Traits/Locale.php +++ b/src/Traits/Locale.php @@ -2,8 +2,8 @@ namespace Rmunate\Utilities\Traits; -use Rmunate\Utilities\Langs\Langs; use Illuminate\Support\Facades\App; +use Rmunate\Utilities\Langs\Langs; use Rmunate\Utilities\Miscellaneous\Utilities; trait Locale