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

Add mobile phone function in fr_FR provider #552

Merged
merged 3 commits into from
May 20, 2015
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
20 changes: 20 additions & 0 deletions src/Faker/Provider/fr_FR/PhoneNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,24 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber
'08 ## ## ## ##',
'09 ## ## ## ##',
);

// Mobile phone numbers start by 06 and 07
// 06 is the most common prefix
protected static $formatsmobile = array(
Copy link
Owner

Choose a reason for hiding this comment

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

$mobileFormats ?


'+33 6 ## ## ## ##',
'+33 7 ## ## ## ##',
'06########',
'07########',
'06 ## ## ## ##',
'07 ## ## ## ##',
);

/**
* @example '0601020304'
*/
public static function mobileNumber()
{
return static::numerify(static::randomElement(static::$formatsmobile));
}
}