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

Add greek mobile and toll-free phone numbers #869

Merged
merged 2 commits into from
Apr 29, 2016
Merged
Changes from all commits
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
76 changes: 71 additions & 5 deletions src/Faker/Provider/el_GR/PhoneNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,82 @@

class PhoneNumber extends \Faker\Provider\PhoneNumber
{
/**
* @link https://en.wikipedia.org/wiki/Telephone_numbers_in_Greece
*/
protected static $formats = array(
// International formats
'+30 2# ########',
'+30 6# ########',
'+30 2## #######',
'+30 2### ######',
'+30 6### ######',
'+302#########',
'+306#########',

'+3069########',
'+30 69 ########',
'+30 69########',
'+30 69# #######',
'+30 69# ### ####',
'+30 69# #### ###',
'+30 69## ######',
'+30 69## ## ## ##',
'+30 69## ### ###',

// Standard format
'2#########',
'6#########',
'2## #######',
'2### ######',
'6### ######',

'69########',
'69# #######',
'69# ### ####',
'69# #### ###',
'69## ######',
'69## ## ## ##',
'69## ### ###',
);

protected static $mobileFormats = array(
// International formats
'+3069########',
'+30 69########',
'+30 69# #######',
'+30 69# ### ####',
'+30 69# #### ###',
'+30 69## ######',
'+30 69## ## ## ##',
'+30 69## ### ###',

// Standard formats
'69########',
'69# #######',
'69# ### ####',
'69# #### ###',
'69## ######',
'69## ## ## ##',
'69## ### ###',
);

public static function mobilePhoneNumber()
{
return static::numerify(static::randomElement(static::$mobileFormats));
}

protected static $tollFreeFormats = array(
// International formats
'+30 800#######',
'+30 800 #######',
'+30 800 ## #####',
'+30 800 ### ####',

// Standard formats
'800#######',
'800 #######',
'800 ## #####',
'800 ### ####',
);

public static function tollFreeNumber()
{
return static::numerify(static::randomElement(static::$tollFreeFormats));
}
}