@@ -7,16 +7,14 @@ class CountryPhoneCallback
77 /**
88 * Create a new phone validator instance.
99 *
10- * @param mixed $value The phone number to validate.
11- * @param string $code The country codes to validate against. String can be separated by comma
12- * @param string|null $attribute
10+ * @param mixed $value The phone number to validate.
11+ * @param string $code The country codes to validate against. String can be separated by comma
12+ * @param string|null $attribute
1313 */
1414 public function __construct (protected $ value , protected string $ code , $ attribute = null )
1515 {
1616 }
1717
18-
19-
2018 protected function validateBJ (): bool
2119 {
2220 return preg_match ('/^(\+229|00229|229)?\d{8}$/ ' , $ this ->value );
@@ -25,9 +23,9 @@ protected function validateBJ(): bool
2523 /**
2624 * Call the phone validator method for each country code and return the results.
2725 *
28- * @throws \BadMethodCallException if the validator method for a country code does not exist.
29- *
3026 * @return array An array of validation results, where each key is a country code and the value is either `true` or `false`.
27+ *
28+ * @throws \BadMethodCallException if the validator method for a country code does not exist.
3129 */
3230 public function callPhoneValidator (): array
3331 {
@@ -38,7 +36,7 @@ public function callPhoneValidator(): array
3836 $ codes = array_map ('strtoupper ' , $ codes );
3937
4038 foreach ($ codes as $ code ) {
41- $ methodName = 'validate ' . $ code ;
39+ $ methodName = 'validate ' . $ code ;
4240
4341 if (method_exists ($ this , $ methodName )) {
4442 $ results [$ code ] = $ this ->{$ methodName }();
0 commit comments