mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-04-21 16:01:56 +02:00
Merge pull request #1586 from ikerasLT/master
add gender variants for last name [lt_LT]
This commit is contained in:
commit
43f979db77
@ -13,6 +13,11 @@ class Person extends \Faker\Provider\Person
|
||||
'{{firstNameFemale}} {{lastNameFemale}}',
|
||||
);
|
||||
|
||||
protected static $lastNameFormat = array(
|
||||
'{{firstNameMale}}',
|
||||
'{{firstNameFemale}}',
|
||||
);
|
||||
|
||||
protected static $titleMale = array('p.', 'ponas');
|
||||
|
||||
protected static $titleFemale = array('p.', 'ponia', 'panelė');
|
||||
@ -247,6 +252,22 @@ class Person extends \Faker\Provider\Person
|
||||
'Petrauskaitė', 'Vasiliauskaitė', 'Butkutė', 'Pociūtė', 'Lukoševičiūtė', 'Balčiūnaitė', 'Kavaliauskaitė'
|
||||
);
|
||||
|
||||
/**
|
||||
* @param string|null $gender 'male', 'female' or null for any
|
||||
* @example 'Doe'
|
||||
* @return string
|
||||
*/
|
||||
public function lastName($gender = null)
|
||||
{
|
||||
if ($gender === static::GENDER_MALE) {
|
||||
return static::lastNameMale();
|
||||
} elseif ($gender === static::GENDER_FEMALE) {
|
||||
return static::lastNameFemale();
|
||||
}
|
||||
|
||||
return $this->generator->parse(static::randomElement(static::$lastNameFormat));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return male last name
|
||||
* @return string
|
||||
|
Loading…
x
Reference in New Issue
Block a user