added custom provider for min username length for faker

This commit is contained in:
2023-03-24 08:59:15 +10:00
parent 7c9f901a7a
commit d11ac9240c
3 changed files with 27 additions and 6 deletions

View File

@@ -0,0 +1,16 @@
<?php
namespace Faker\Provider;
use Faker\Provider\Internet as BaseInternet;
class CustomInternetProvider extends BaseInternet
{
public function userNameWithMinLength($minLength = 6)
{
$username = $this->userName();
while (strlen($username) < $minLength) {
$username .= $this->randomNumber();
}
return $username;
}
}