mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-03-22 08:19:52 +01:00
Utils class become Transliteration
This commit is contained in:
parent
03c2656d05
commit
7b0cb531b2
@ -14,7 +14,7 @@ class Internet extends \Faker\Provider\Internet
|
||||
{
|
||||
$format = static::randomElement(static::$userNameFormats);
|
||||
return static::toLower(static::bothify(
|
||||
Utils::cyrillicToLatin($this->generator->parse($format))
|
||||
Transliteration::transliterate($this->generator->parse($format))
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -26,7 +26,7 @@ class Internet extends \Faker\Provider\Internet
|
||||
{
|
||||
$company = $this->generator->format('companyUrl');
|
||||
$company = str_replace(' ', '-', $company);
|
||||
$company = Utils::cyrillicToLatin($company);
|
||||
$company = Transliteration::transliterate($company);
|
||||
return $company;
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,9 @@
|
||||
namespace Faker\Provider\ua_UA;
|
||||
|
||||
/**
|
||||
* Some utils what ua_UA provider needs
|
||||
* Cyrillic to latin transliteration util
|
||||
*/
|
||||
Class Utils
|
||||
Class Transliteration
|
||||
{
|
||||
/**
|
||||
* Translate cyrillic text to latin
|
||||
@ -13,7 +13,7 @@ Class Utils
|
||||
* @param string $string
|
||||
* @return string
|
||||
*/
|
||||
public static function cyrillicToLatin($string = '') {
|
||||
public static function transliterate($string = '') {
|
||||
$replace=array(
|
||||
"'"=>"",
|
||||
"`"=>"",
|
Loading…
x
Reference in New Issue
Block a user