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

Commit d86496c

Browse files
committed
Merge pull request #552 from kletellier/change_fr_provider
Add mobile phone function in fr_FR provider
2 parents b7371e6 + ae71113 commit d86496c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Faker/Provider/fr_FR/PhoneNumber.php

+19
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,23 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber
4848
'08 ## ## ## ##',
4949
'09 ## ## ## ##',
5050
);
51+
52+
// Mobile phone numbers start by 06 and 07
53+
// 06 is the most common prefix
54+
protected static $mobileFormats = array(
55+
'+33 6 ## ## ## ##',
56+
'+33 7 ## ## ## ##',
57+
'06########',
58+
'07########',
59+
'06 ## ## ## ##',
60+
'07 ## ## ## ##',
61+
);
62+
63+
/**
64+
* @example '0601020304'
65+
*/
66+
public static function mobileNumber()
67+
{
68+
return static::numerify(static::randomElement(static::$mobileFormats));
69+
}
5170
}

0 commit comments

Comments
 (0)