Skip to content

Commit 646aa18

Browse files
committed
Add chance that customer names will be all lowercase
1 parent 84bc4e2 commit 646aa18

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

includes/Generator/CustomerInfo.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ public static function generate_person( string $country_code = '' ) {
109109
$first_name = $faker->firstName( $faker->randomElement( array( 'male', 'female' ) ) );
110110
$last_name = $faker->lastName();
111111

112+
if ( $faker->randomDigit() < 3 ) {
113+
// 30% chance for no capitalization.
114+
$first_name = strtolower( $first_name );
115+
$last_name = strtolower( $last_name );
116+
}
117+
112118
$person = array(
113119
'first_name' => $first_name,
114120
'last_name' => $last_name,
@@ -177,6 +183,11 @@ public static function generate_company( string $country_code = '' ) {
177183
}
178184
}
179185

186+
if ( $faker->randomDigit() < 3 ) {
187+
// 30% chance for no capitalization.
188+
$last_names = array_map( 'strtolower', $last_names );
189+
}
190+
180191
// Make sure all the company-related strings draw from the same set of last names that were previously generated.
181192
$person_provider = self::get_provider_instance( $faker, 'Person' );
182193
$reflected_provider = new \ReflectionClass( $person_provider );

0 commit comments

Comments
 (0)