1
0
mirror of https://github.com/fzaninotto/Faker.git synced 2025-03-22 00:09:59 +01:00

Merge branch 'master' of git://github.com/fzaninotto/Faker into provider/file

This commit is contained in:
Ando Roots 2013-03-08 11:50:13 +02:00
commit e279febfbd
13 changed files with 10 additions and 15 deletions

View File

@ -160,6 +160,7 @@ Each of the generator properties (like `name`, `address`, and `lorem`) are calle
randomDigit // 7
randomDigitNotNull // 5
randomNumber($nbDigits = NULL) // 79907610
randomNumber($from, $to) // 39049
randomFloat($nbMaxDecimals = NULL, $min = 0, $max = NULL) // 48.8932
randomLetter // 'b'
randomElement($array = array ('a','b','c')) // 'b'

View File

@ -4,7 +4,6 @@ namespace Faker\Provider;
class Internet extends \Faker\Provider\Base
{
protected static $safeEmailTld = array('org', 'com', 'net');
protected static $freeEmailDomain = array('gmail.com', 'yahoo.com', 'hotmail.com');
protected static $tld = array('com', 'com', 'com', 'com', 'com', 'com', 'biz', 'info', 'net', 'org');
@ -36,7 +35,7 @@ class Internet extends \Faker\Provider\Base
/**
* @example 'jdoe@example.com'
*/
public function safeEmail()
public final function safeEmail()
{
return preg_replace('/\s/', '', $this->userName() . '@' . static::safeEmailDomain());
}
@ -68,9 +67,15 @@ class Internet extends \Faker\Provider\Base
/**
* @example 'example.org'
*/
public static function safeEmailDomain()
public static final function safeEmailDomain()
{
return 'example.' . static::randomElement(static::$safeEmailTld);
$domains = array(
'example.com',
'example.org',
'example.net'
);
return static::randomElement($domains);
}
/**
* @example 'jdoe'

View File

@ -4,7 +4,6 @@ namespace Faker\Provider\bg_BG;
class Internet extends \Faker\Provider\Internet
{
protected static $safeEmailTld = array('org', 'com', 'net', 'bg');
protected static $freeEmailDomain = array('gmail.com', 'yahoo.com', 'hotmail.com', 'mail.bg', 'abv.bg', 'dir.bg');
protected static $tld = array('bg', 'bg', 'bg', 'bg', 'bg', 'bg', 'com', 'biz', 'info', 'net', 'org');

View File

@ -4,7 +4,6 @@ namespace Faker\Provider\cs_CZ;
class Internet extends \Faker\Provider\Internet
{
protected static $safeEmailTld = array('com', 'cz');
protected static $freeEmailDomain = array('gmail.com', 'yahoo.com', 'seznam.cz', 'atlas.cz', 'centrum.cz', 'email.cz', 'post.cz');

View File

@ -4,7 +4,6 @@ namespace Faker\Provider\de_DE;
class Internet extends \Faker\Provider\Internet
{
protected static $safeEmailTld = array('com', 'net', 'de', 'de');
protected static $freeEmailDomain = array('web.de', 'gmail.com', 'hotmail.de', 'yahoo.de', 'googlemail.com', 'aol.de', 'gmx.de');
protected static $tld = array('com', 'com', 'com', 'net', 'org', 'de', 'de', 'de');

View File

@ -4,7 +4,6 @@ namespace Faker\Provider\en_GB;
class Internet extends \Faker\Provider\Internet
{
protected static $safeEmailTld = array('org', 'com', 'net', 'co.uk');
protected static $freeEmailDomain = array('gmail.com', 'yahoo.com', 'hotmail.com', 'gmail.co.uk', 'yahoo.co.uk', 'hotmail.co.uk');
protected static $tld = array('com', 'com', 'com', 'com', 'com', 'com', 'biz', 'info', 'net', 'org', 'co.uk');
}

View File

@ -4,7 +4,6 @@ namespace Faker\Provider\fi_FI;
class Internet extends \Faker\Provider\Internet
{
protected static $safeEmailTld = array('org', 'com', 'net', 'fi');
protected static $freeEmailDomain = array('gmail.com', 'yahoo.com', 'hotmail.com', 'jippii.fi', 'luukku.com');
protected static $tld = array('com', 'com', 'com', 'com', 'com', 'com', 'biz', 'info', 'net', 'org', 'fi');
}

View File

@ -4,7 +4,6 @@ namespace Faker\Provider\fr_FR;
class Internet extends \Faker\Provider\Internet
{
protected static $safeEmailTld = array('com', 'net', 'fr', 'fr');
protected static $freeEmailDomain = array('voila.fr', 'gmail.com', 'hotmail.fr', 'yahoo.fr', 'laposte.net', 'free.fr', 'sfr.fr', 'orange.fr', 'bouygtel.fr', 'club-internet.fr', 'dbmail.com', 'live.com', 'ifrance.com', 'noos.fr', 'tele2.fr', 'tiscali.fr', 'wanadoo.fr');
protected static $tld = array('com', 'com', 'com', 'net', 'org', 'fr', 'fr', 'fr');

View File

@ -4,7 +4,6 @@ namespace Faker\Provider\it_IT;
class Internet extends \Faker\Provider\Internet
{
protected static $safeEmailTld = array('org', 'com', 'net', 'it');
protected static $freeEmailDomain = array('gmail.com', 'yahoo.com', 'hotmail.com', 'email.it', 'libero.it', 'yahoo.it');
protected static $tld = array('com', 'com', 'com', 'net', 'org', 'it', 'it', 'it');
}

View File

@ -4,7 +4,6 @@ namespace Faker\Provider\nl_BE;
class Internet extends \Faker\Provider\Internet
{
protected static $safeEmailTld = array('com', 'net', 'be', 'be');
protected static $freeEmailDomain = array('gmail.com', 'hotmail.com', 'yahoo.com', 'advalvas.be');
protected static $tld = array('com', 'com', 'com', 'net', 'org', 'be', 'be', 'be');

View File

@ -4,7 +4,6 @@ namespace Faker\Provider\nl_NL;
class Internet extends \Faker\Provider\Internet
{
protected static $safeEmailTld = array('com', 'net', 'nl', 'nl');
protected static $freeEmailDomain = array('gmail.com', 'hotmail.nl', 'live.nl', 'yahoo.nl');
protected static $tld = array('com', 'com', 'com', 'net', 'org', 'nl', 'nl', 'nl');
}

View File

@ -4,7 +4,6 @@ namespace Faker\Provider\pl_PL;
class Internet extends \Faker\Provider\Internet
{
protected static $safeEmailTld = array('com', 'pl');
protected static $freeEmailDomain = array('gmail.com', 'yahoo.com', 'wp.pl', 'onet.pl', 'interia.pl', 'gazeta.pl');

View File

@ -4,7 +4,6 @@ namespace Faker\Provider\sk_SK;
class Internet extends \Faker\Provider\Internet
{
protected static $safeEmailTld = array('com', 'sk');
protected static $freeEmailDomain = array('gmail.com', 'yahoo.com', 'zoznam.sk', 'atlas.', 'centrum.sk', 'azet.sk', 'post.sk');