Skip to content

Commit

Permalink
Merge pull request #21 from rmunate/analysis-Q3B3Wj
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
rmunate authored Nov 7, 2023
2 parents 48cf732 + b39cb43 commit 9c980a2
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 56 deletions.
5 changes: 1 addition & 4 deletions src/Langs/Langs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -63,5 +61,4 @@ final class Langs
'pt' => 'de', // Portuguese from Portugal: "de"
'ro' => 'de', // Romanian from Romania: "de"
];

}
78 changes: 39 additions & 39 deletions src/Langs/Replaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand All @@ -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',
],
];
Expand Down
10 changes: 5 additions & 5 deletions src/Miscellaneous/Words.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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.
*/
Expand Down
10 changes: 5 additions & 5 deletions src/SpellNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/Accesor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand All @@ -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);
}
}
2 changes: 1 addition & 1 deletion src/Traits/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9c980a2

Please sign in to comment.