We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d3d3fe commit 5b7b639Copy full SHA for 5b7b639
content/1.getting-started/7.custom-extension.md
@@ -13,12 +13,15 @@ class CustomEmailExtension extends Extension
13
{
14
public function generateRandomEmail(string $domainName): mixed
15
16
- $localPart = strtolower(bin2hex(random_bytes(4)));
+ $randomBytes = $this->randomizer->getBytes(4);
17
+ $localPart = strtolower(bin2hex($randomBytes));
18
return $localPart . '@' . $domainName;
19
}
20
21
```
22
23
+`$this->randomizer` is the PHP 8 [Randomizer instance](https://www.php.net/manual/en/class.random-randomizer.php)
24
+
25
You'll also need to load your extension into Faker
26
```php
27
faker()->resolveExtensions([CustomEmailExtension::class])
0 commit comments