@@ -13,7 +13,7 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber
13
13
'+33 (0)3 ## ## ## ## ' ,
14
14
'+33 (0)4 ## ## ## ## ' ,
15
15
'+33 (0)5 ## ## ## ## ' ,
16
- '+33 (0)6 ## ## ## ## ' ,
16
+ '+33 (0)6 {{phoneNumber06WithSeparator}} ' ,
17
17
'+33 (0)7 {{phoneNumber07WithSeparator}} ' ,
18
18
'+33 (0)8 {{phoneNumber08WithSeparator}} ' ,
19
19
'+33 (0)9 ## ## ## ## ' ,
@@ -23,7 +23,7 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber
23
23
'+33 3 ## ## ## ## ' ,
24
24
'+33 4 ## ## ## ## ' ,
25
25
'+33 5 ## ## ## ## ' ,
26
- '+33 6 ## ## ## ## ' ,
26
+ '+33 6 {{phoneNumber06WithSeparator}} ' ,
27
27
'+33 7 {{phoneNumber07WithSeparator}} ' ,
28
28
'+33 8 {{phoneNumber08WithSeparator}} ' ,
29
29
'+33 9 ## ## ## ## ' ,
@@ -33,7 +33,7 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber
33
33
'03######## ' ,
34
34
'04######## ' ,
35
35
'05######## ' ,
36
- '06######## ' ,
36
+ '06{{phoneNumber06}} ' ,
37
37
'07{{phoneNumber07}} ' ,
38
38
'08{{phoneNumber08}} ' ,
39
39
'09######## ' ,
@@ -43,7 +43,7 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber
43
43
'03 ## ## ## ## ' ,
44
44
'04 ## ## ## ## ' ,
45
45
'05 ## ## ## ## ' ,
46
- '06 ## ## ## ## ' ,
46
+ '06 {{phoneNumber06WithSeparator}} ' ,
47
47
'07 {{phoneNumber07WithSeparator}} ' ,
48
48
'08 {{phoneNumber08WithSeparator}} ' ,
49
49
'09 ## ## ## ## ' ,
@@ -52,13 +52,13 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber
52
52
// Mobile phone numbers start by 06 and 07
53
53
// 06 is the most common prefix
54
54
protected static $ mobileFormats = [
55
- '+33 (0)6 ## ## ## ## ' ,
56
- '+33 6 ## ## ## ## ' ,
55
+ '+33 (0)6 {{phoneNumber06WithSeparator}} ' ,
56
+ '+33 6 {{phoneNumber06WithSeparator}} ' ,
57
57
'+33 (0)7 {{phoneNumber07WithSeparator}} ' ,
58
58
'+33 7 {{phoneNumber07WithSeparator}} ' ,
59
- '06######## ' ,
59
+ '06{{phoneNumber06}} ' ,
60
60
'07{{phoneNumber07}} ' ,
61
- '06 ## ## ## ## ' ,
61
+ '06 {{phoneNumber06WithSeparator}} ' ,
62
62
'07 {{phoneNumber07WithSeparator}} ' ,
63
63
];
64
64
@@ -73,6 +73,26 @@ class PhoneNumber extends \Faker\Provider\PhoneNumber
73
73
'+33######### ' ,
74
74
];
75
75
76
+ public function phoneNumber06 ()
77
+ {
78
+ $ phoneNumber = $ this ->phoneNumber06WithSeparator ();
79
+
80
+ return str_replace (' ' , '' , $ phoneNumber );
81
+ }
82
+
83
+ /**
84
+ * Only 0601 to 0638, 0640 to 0689, 0695 and 0698 to 0699 are acceptable prefixes with 06
85
+ *
86
+ * @see https://www.arcep.fr/la-regulation/grands-dossiers-thematiques-transverses/la-numerotation.html#c8961
87
+ * @see https://www.itu.int/itu-t/nnp/#/numbering-plans?country=France%C2%A0&code=33
88
+ */
89
+ public function phoneNumber06WithSeparator ()
90
+ {
91
+ $ regex = '([0-24-8]\d|3[0-8]|9[589])( \d{2}){3} ' ;
92
+
93
+ return static ::regexify ($ regex );
94
+ }
95
+
76
96
public function phoneNumber07 ()
77
97
{
78
98
$ phoneNumber = $ this ->phoneNumber07WithSeparator ();
@@ -81,16 +101,16 @@ public function phoneNumber07()
81
101
}
82
102
83
103
/**
84
- * Only 073 to 079 are acceptable prefixes with 07
104
+ * Only 0730 to 0789 are acceptable prefixes with 07
85
105
*
86
- * @see http://www.arcep.fr/index.php?id=8146
106
+ * @see https://www.arcep.fr/la-regulation/grands-dossiers-thematiques-transverses/la-numerotation.html#c8961
107
+ * @see https://www.itu.int/itu-t/nnp/#/numbering-plans?country=France%C2%A0&code=33
87
108
*/
88
109
public function phoneNumber07WithSeparator ()
89
110
{
90
- $ phoneNumber = $ this ->generator ->numberBetween (3 , 9 );
91
- $ phoneNumber .= $ this ->numerify ('# ## ## ## ' );
111
+ $ regex = '([3-8]\d)( \d{2}){3} ' ;
92
112
93
- return $ phoneNumber ;
113
+ return static :: regexify ( $ regex ) ;
94
114
}
95
115
96
116
public function phoneNumber08 ()
@@ -121,9 +141,9 @@ public function phoneNumber08()
121
141
*/
122
142
public function phoneNumber08WithSeparator ()
123
143
{
124
- $ regex = '([012]{1}\d{1} |(9[1-357-9])( \d{2}){3} ' ;
144
+ $ regex = '([012]\d |(9[1-357-9])( \d{2}){3} ' ;
125
145
126
- return $ this -> regexify ($ regex );
146
+ return static :: regexify ($ regex );
127
147
}
128
148
129
149
/**
0 commit comments