mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-03-22 00:09:59 +01:00
Merge pull request #110 from csanquer/feature_safe_email_domain
adding a safe email domain generator method
This commit is contained in:
commit
fe9c56fa5b
@ -114,6 +114,7 @@ Each of the generator properties (like `name`, `address`, and `lorem`) are calle
|
||||
freeEmail // 'bradley72@gmail.com'
|
||||
companyEmail // 'russel.durward@mcdermott.org'
|
||||
freeEmailDomain // 'yahoo.com'
|
||||
safeEmailDomain // 'example.org'
|
||||
userName // 'wade55'
|
||||
domainName // 'wolffdeckow.net'
|
||||
domainWord // 'feeney'
|
||||
|
@ -38,7 +38,7 @@ class Internet extends \Faker\Provider\Base
|
||||
*/
|
||||
public function safeEmail()
|
||||
{
|
||||
return preg_replace('/\s/', '', $this->userName() . '@example.' . static::randomElement(static::$safeEmailTld));
|
||||
return preg_replace('/\s/', '', $this->userName() . '@' . static::safeEmailDomain());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -64,7 +64,14 @@ class Internet extends \Faker\Provider\Base
|
||||
{
|
||||
return static::randomElement(static::$freeEmailDomain);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @example 'example.org'
|
||||
*/
|
||||
public static function safeEmailDomain()
|
||||
{
|
||||
return 'example.' . static::randomElement(static::$safeEmailTld);
|
||||
}
|
||||
/**
|
||||
* @example 'jdoe'
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user