@@ -17,42 +17,42 @@ public function __construct(protected $value, protected string $code, $attribute
1717
1818 protected function validateTG ()
1919 {
20- return preg_match ('/^(\+228|00228|228)?\d{8}$/ ' , $ this ->value );
20+ return preg_match ('/^(?: \+228|00228|228)?\d{8}$/ ' , $ this ->value );
2121 }
2222
2323 protected function validateNE ()
2424 {
25- return preg_match ('/^(\+227|00227|227)?\d{8}$/ ' , $ this ->value );
25+ return preg_match ('/^(?: \+227|00227|227)?\d{8}$/ ' , $ this ->value );
2626 }
2727
2828 protected function validateGW ()
2929 {
30- return preg_match ('/^(\+245|00245|245)?\d{7,8}$/ ' , $ this ->value );
30+ return preg_match ('/^(?: \+245|00245|245)?\d{7,8}$/ ' , $ this ->value );
3131 }
3232
3333 protected function validateTD ()
3434 {
35- return preg_match ('/^(\+235|00235|235)?\d{8}$/ ' , $ this ->value );
35+ return preg_match ('/^(?: \+235|00235|235)?\d{8}$/ ' , $ this ->value );
3636 }
3737
3838 protected function validateCM ()
3939 {
40- return preg_match ('/^(\+237|00237|237)?\d{8}$/ ' , $ this ->value );
40+ return preg_match ('/^(?: \+237|00237|237)?\d{8}$/ ' , $ this ->value );
4141 }
4242
4343 protected function validateBF ()
4444 {
45- return preg_match ('/^(\+226|00226|226)?\d{8}$/ ' , $ this ->value );
45+ return preg_match ('/^(?: \+226|00226|226)?\d{8}$/ ' , $ this ->value );
4646 }
4747
4848 protected function validateAO (): bool
4949 {
50- return preg_match ('/^(\+244|00244|244)?[9,2][1-9]\d{7}$/ ' , $ this ->value );
50+ return preg_match ('/^(?: \+244|00244|244)?[9,2][1-9]\d{7}$/ ' , $ this ->value );
5151 }
5252
5353 protected function validateBJ (): bool
5454 {
55- return preg_match ('/^(\+229|00229|229)?\d{8}$/ ' , $ this ->value );
55+ return preg_match ('/^(?: \+229|00229|229)?\d{8}$/ ' , $ this ->value );
5656 }
5757
5858 /**
@@ -71,7 +71,7 @@ public function callPhoneValidator(): array
7171 $ codes = array_map ('strtoupper ' , $ codes );
7272
7373 foreach ($ codes as $ code ) {
74- $ methodName = 'validate ' . $ code ;
74+ $ methodName = 'validate ' . $ code ;
7575
7676 if (method_exists ($ this , $ methodName )) {
7777 $ results [$ code ] = $ this ->{$ methodName }();
0 commit comments