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

Add lastName gender specific on ru_RU locale #1747

Merged
merged 11 commits into from
Sep 3, 2019
14 changes: 14 additions & 0 deletions src/Faker/Provider/ru_RU/Person.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,18 @@ public function middleName($gender = null)
static::GENDER_FEMALE,
)));
}

/**
* Return last name for the specified gender.
*
* @access public
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if using the @access annotation here is something we really need - it duplicates the public visibility keyword that is already present. Can we remove it?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, please remove it

* @param string|null $gender A gender of the last name should be generated
* for. If the argument is skipped a random gender will be used.
* @return string Last name
*/
public function lastName($gender = null)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly or is the generated lastName always Male by default? Shouldn't it return a random gender?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, missed that one.

@aanfarhan

Can you adjust, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I'll add some adjustment to the code.

{
return ($gender === static::GENDER_FEMALE) ?
static::randomElement(static::$lastName) . 'a' : static::randomElement(static::$lastName);
}
}