This repository was archived by the owner on Dec 11, 2020. It is now read-only.
Commit 6917948 1 parent be65136 commit 6917948 Copy full SHA for 6917948
File tree 1 file changed +15
-2
lines changed
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Faker\Provider;
4
4
5
+ use Faker\Factory;
6
+
5
7
class Internet extends \Faker\Provider\Base
6
8
{
7
9
protected static $freeEmailDomain = array('gmail.com', 'yahoo.com', 'hotmail.com');
@@ -98,7 +100,7 @@ public function userName()
98
100
99
101
// fallback in case transliterate() doesn't support the language and removed all letters
100
102
if ($username === '') {
101
- return $this->generator->word ;
103
+ return $this->fakerEn()->userName ;
102
104
}
103
105
104
106
return $username;
@@ -133,7 +135,7 @@ public function domainWord()
133
135
134
136
// fallback in case transliterate() doesn't support the language and removed all letters
135
137
if ($lastName === '') {
136
- return $this->generator->word ;
138
+ return $this->fakerEn()->domainWord ;
137
139
}
138
140
139
141
return $lastName;
@@ -352,4 +354,15 @@ protected static function toAscii($string)
352
354
353
355
return str_replace($arrayFrom, $arrayTo, $string);
354
356
}
357
+
358
+ protected function fakerEn()
359
+ {
360
+ static $fakerEn;
361
+
362
+ if (!isset($fakerEn)) {
363
+ $fakerEn = Factory::create('en_US');
364
+ }
365
+
366
+ return $fakerEn;
367
+ }
355
368
}
You can’t perform that action at this time.
0 commit comments