mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-03-22 08:19:52 +01:00
Merge pull request #148 from vjnrv/pt_BR_internet
[pt_BR] Created Internet Provider
This commit is contained in:
commit
e8cff786aa
44
src/Faker/Provider/pt_BR/Internet.php
Normal file
44
src/Faker/Provider/pt_BR/Internet.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Faker\Provider\pt_BR;
|
||||
|
||||
class Internet extends \Faker\Provider\Internet
|
||||
{
|
||||
protected static $freeEmailDomain = array('gmail.com', 'yahoo.com', 'hotmail.com', 'uol.com.br', 'terra.com.br', 'ig.com.br');
|
||||
protected static $tld = array('com', 'com', 'com.br', 'com.br', 'net', 'net.br', 'br', 'org');
|
||||
|
||||
/**
|
||||
* Converts pt-BR characters to their ASCII representation
|
||||
*
|
||||
* @param string $string
|
||||
* @return string
|
||||
*/
|
||||
private static function toAscii($string)
|
||||
{
|
||||
return preg_replace('/&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml|caron);/i', '$1',
|
||||
htmlentities($string, ENT_QUOTES, 'UTF-8'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @example 'jdoe'
|
||||
*/
|
||||
public function userName()
|
||||
{
|
||||
$format = static::randomElement(static::$userNameFormats);
|
||||
|
||||
return static::toLower(static::toAscii(static::bothify($this->generator->parse($format))));
|
||||
}
|
||||
|
||||
/**
|
||||
* @example 'faber'
|
||||
*/
|
||||
public function domainWord()
|
||||
{
|
||||
$company = $this->generator->format('company');
|
||||
$companyElements = explode(' ', $company);
|
||||
$company = $companyElements[0];
|
||||
$company = preg_replace('/\W/u', '', $company);
|
||||
|
||||
return static::toLower(static::toAscii($company));
|
||||
}
|
||||
}
|
@ -74,7 +74,7 @@ class Person extends \Faker\Provider\Person
|
||||
'Salazar', 'Sales', 'Salgado', 'Sanches', 'Sandoval', 'Santacruz',
|
||||
'Santana', 'Santiago', 'Saraiva', 'Sepúlveda', 'Serna', 'Serra',
|
||||
'Serrano', 'Soares', 'Solano', 'Soto', 'Tamoio', 'Teles', 'Toledo',
|
||||
'Torres', 'Uchoa', 'Urias', 'Valdez', 'Valẽncia', 'Valentin', 'Vale',
|
||||
'Torres', 'Uchoa', 'Urias', 'Valdez', 'Valência', 'Valentin', 'Vale',
|
||||
'Vasques', 'Vega', 'Velasques', 'Verdugo', 'Verdara', 'Vieira', 'Vila',
|
||||
'Zamana', 'Zambrano', 'Zaragoça', 'da Cruz', 'da Rosa', 'da Silva',
|
||||
'das Dores', 'das Neves', 'de Aguiar', 'de Oliveira', 'de Souza'
|
||||
|
Loading…
x
Reference in New Issue
Block a user