Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1586 from ikerasLT/master
Browse files Browse the repository at this point in the history
add gender variants for last name [lt_LT]
  • Loading branch information
fzaninotto authored Oct 17, 2019
2 parents 56c3823 + 868e707 commit 43f979d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Faker/Provider/lt_LT/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -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ė');
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 43f979d

Please sign in to comment.