@@ -25,12 +25,12 @@ |
||
25 | 25 | */ |
26 | 26 | public function __construct() |
27 | 27 | { |
28 | - $app_lang = resource_path('lang/validation/'.App::getLocale().'.php'); |
|
28 | + $app_lang = resource_path('lang/validation/' . App::getLocale() . '.php'); |
|
29 | 29 | |
30 | - if (! file_exists($app_lang)) { |
|
30 | + if (!file_exists($app_lang)) { |
|
31 | 31 | $this->lang = include $app_lang; |
32 | 32 | } else { |
33 | - $this->lang = include __DIR__.'/lang/validation/'.App::getLocale().'.php'; |
|
33 | + $this->lang = include __DIR__ . '/lang/validation/' . App::getLocale() . '.php'; |
|
34 | 34 | } |
35 | 35 | } |
36 | 36 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | */ |
22 | 22 | public function rule($attribute, $value, $parameters, $validator): bool |
23 | 23 | { |
24 | - if (! preg_match('/^\d{16}$/', $value)) { |
|
24 | + if (!preg_match('/^\d{16}$/', $value)) { |
|
25 | 25 | return false; |
26 | 26 | } |
27 | 27 | $sum = 0; |
@@ -21,14 +21,14 @@ |
||
21 | 21 | */ |
22 | 22 | public function rule($attribute, $value, $parameters, $validator): bool |
23 | 23 | { |
24 | - if (! preg_match('/^\d{8,10}$/', $value) || preg_match('/^[0]{10}|[1]{10}|[2]{10}|[3]{10}|[4]{10}|[5]{10}|[6]{10}|[7]{10}|[8]{10}|[9]{10}$/', $value)) { |
|
24 | + if (!preg_match('/^\d{8,10}$/', $value) || preg_match('/^[0]{10}|[1]{10}|[2]{10}|[3]{10}|[4]{10}|[5]{10}|[6]{10}|[7]{10}|[8]{10}|[9]{10}$/', $value)) { |
|
25 | 25 | return false; |
26 | 26 | } |
27 | 27 | $sub = 0; |
28 | 28 | if (strlen($value) == 8) { |
29 | - $value = '00'.$value; |
|
29 | + $value = '00' . $value; |
|
30 | 30 | } elseif (strlen($value) == 9) { |
31 | - $value = '0'.$value; |
|
31 | + $value = '0' . $value; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | for ($i = 0; $i <= 8; $i++) { |
@@ -38,10 +38,10 @@ discard block |
||
38 | 38 | public function boot() |
39 | 39 | { |
40 | 40 | $this->publishes([ |
41 | - __DIR__.'/lang/validation/'.App::getLocale().'.php' => resource_path('lang/validation/'.App::getLocale().'.php'), |
|
41 | + __DIR__ . '/lang/validation/' . App::getLocale() . '.php' => resource_path('lang/validation/' . App::getLocale() . '.php'), |
|
42 | 42 | ]); |
43 | 43 | |
44 | - foreach (glob(__DIR__.'/Rules/*.php') as $file) { |
|
44 | + foreach (glob(__DIR__ . '/Rules/*.php') as $file) { |
|
45 | 45 | require_once $file; |
46 | 46 | |
47 | 47 | // get the file name of the current file without the extension |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | $class = basename($file, '.php'); |
50 | 50 | |
51 | 51 | $Rule = 'Iamfarhad\Validation\Rules'; |
52 | - if (class_exists($Rule.'\\'.$class)) { |
|
53 | - $reflectionClass = new \ReflectionClass($Rule.'\\'.$class); |
|
54 | - if (! $reflectionClass->isInstance((object) AbstractValidationRule::class)) { |
|
52 | + if (class_exists($Rule . '\\' . $class)) { |
|
53 | + $reflectionClass = new \ReflectionClass($Rule . '\\' . $class); |
|
54 | + if (!$reflectionClass->isInstance((object) AbstractValidationRule::class)) { |
|
55 | 55 | throw new \Exception('this extension is not instance of AbstractValidationRule'); |
56 | 56 | } |
57 | 57 | // Register extension |