middleNameMale(); } elseif ($gender === static::GENDER_FEMALE) { return $this->middleNameFemale(); } return $this->middleName(static::randomElement(array( static::GENDER_MALE, static::GENDER_FEMALE, ))); } /** * Return last name for the specified gender. * * @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) { $lastName = static::randomElement(static::$lastName); if (static::GENDER_FEMALE === $gender) { return $lastName . 'a'; } elseif (static::GENDER_MALE === $gender) { return $lastName; } return $lastName . static::randomElement(static::$lastNameSuffix); } }