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

add phone numer format #1506

Merged
merged 3 commits into from
Jun 18, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/Faker/Provider/ko_KR/PhoneNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,32 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber
'06#-####-####',
'1588-####',
);

protected static $cellPhoneFormats = array(
'010-####-####',
);

public function cellPhoneNumber()
{
$format = self::randomElement(static::$cellPhoneFormats);

return self::numerify($this->generator->parse($format));
}

protected static $commonPhoneFormats = array(
// Standard formats
'070-####-####',
'02-####-####',
'03#-####-####',
'04#-####-####',
'05#-####-####',
'06#-####-####',
);

public function commonPhoneNumber()
Copy link
Owner

Choose a reason for hiding this comment

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

please document new formatters in the locale-specific section of the README.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right.
I thought that I separated old phone number format into two. But for compatibility I remained it.
I will find the way to avoid code duplication.

Thanks for your review.

{
$format = self::randomElement(static::$commonPhoneFormats);

return self::numerify($this->generator->parse($format));
}
}