@@ -20,12 +20,12 @@ |
||
20 | 20 | |
21 | 21 | public function __construct() |
22 | 22 | { |
23 | - $app_lang = resource_path('lang/validation/'. App::getLocale().'.php'); |
|
23 | + $app_lang = resource_path('lang/validation/' . App::getLocale() . '.php'); |
|
24 | 24 | |
25 | - if(!file_exists($app_lang)) { |
|
25 | + if (!file_exists($app_lang)) { |
|
26 | 26 | $this->lang = include $app_lang; |
27 | 27 | } else { |
28 | - $this->lang = include __DIR__.'/lang/validation/'.App::getLocale().'.php'; |
|
28 | + $this->lang = include __DIR__ . '/lang/validation/' . App::getLocale() . '.php'; |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 |
@@ -14,7 +14,7 @@ |
||
14 | 14 | public function rule($attribute, $value, $parameters, $validator): bool |
15 | 15 | { |
16 | 16 | if (is_string($value)) { |
17 | - $this->status = (bool)preg_match("/[\x{600}-\x{6FF}]/u", $value); |
|
17 | + $this->status = (bool) preg_match("/[\x{600}-\x{6FF}]/u", $value); |
|
18 | 18 | return !$this->status; |
19 | 19 | } |
20 | 20 | return false; |
@@ -23,6 +23,6 @@ |
||
23 | 23 | $temp = $temp > 9 ? $temp - 9 : $temp; |
24 | 24 | $sum += $temp; |
25 | 25 | } |
26 | - return (bool)($sum % 10 === 0); |
|
26 | + return (bool) ($sum % 10 === 0); |
|
27 | 27 | } |
28 | 28 | } |
@@ -13,6 +13,6 @@ |
||
13 | 13 | |
14 | 14 | public function rule($attribute, $value, $parameters, $validator): bool |
15 | 15 | { |
16 | - return (bool)preg_match('/^(0[1-9]{2})[2-9][0-9]{7}+$/', $value); |
|
16 | + return (bool) preg_match('/^(0[1-9]{2})[2-9][0-9]{7}+$/', $value); |
|
17 | 17 | } |
18 | 18 | } |
@@ -13,6 +13,6 @@ |
||
13 | 13 | |
14 | 14 | public function rule($attribute, $value, $parameters, $validator): bool |
15 | 15 | { |
16 | - return (bool)preg_match("/^(\d{5}-?\d{5})$/", $value); |
|
16 | + return (bool) preg_match("/^(\d{5}-?\d{5})$/", $value); |
|
17 | 17 | } |
18 | 18 | } |
@@ -13,6 +13,6 @@ |
||
13 | 13 | |
14 | 14 | public function rule($attribute, $value, $parameters, $validator): bool |
15 | 15 | { |
16 | - return (bool) preg_match('/^[2-9][0-9]{7}+$/', $value) ; |
|
16 | + return (bool) preg_match('/^[2-9][0-9]{7}+$/', $value); |
|
17 | 17 | } |
18 | 18 | } |
@@ -13,6 +13,6 @@ |
||
13 | 13 | |
14 | 14 | public function rule($attribute, $value, $parameters, $validator): bool |
15 | 15 | { |
16 | - return (bool)preg_match("/^[\pL\s\d\-\/\,\،\.\\\\\x{200c}\x{064b}\x{064d}\x{064c}\x{064e}\x{064f}\x{0650}\x{0651}\x{6F0}-\x{6F9}]+$/u", $value); |
|
16 | + return (bool) preg_match("/^[\pL\s\d\-\/\,\،\.\\\\\x{200c}\x{064b}\x{064d}\x{064c}\x{064e}\x{064f}\x{0650}\x{0651}\x{6F0}-\x{6F9}]+$/u", $value); |
|
17 | 17 | } |
18 | 18 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | */ |
47 | 47 | public function register(): void |
48 | 48 | { |
49 | - \Validator::extend($this->getValidationRule(), function ($attribute, $value, $parameters, $validator) { |
|
49 | + \Validator::extend($this->getValidationRule(), function($attribute, $value, $parameters, $validator) { |
|
50 | 50 | return $this->rule($attribute, $value, $parameters, $validator); |
51 | 51 | }); |
52 | 52 | \Validator::replacer($this->getValidationRule(), 'ValidationMessages@message'); |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $Rule = 'Iamfarhad\Validation\Rules'; |
52 | 52 | if (class_exists($Rule . '\\' . $class)) { |
53 | 53 | $reflectionClass = new \ReflectionClass($Rule . '\\' . $class); |
54 | - if(!$reflectionClass->implementsInterface(ValidationRuleInterface::class)) { |
|
54 | + if (!$reflectionClass->implementsInterface(ValidationRuleInterface::class)) { |
|
55 | 55 | throw new \Exception('this extenstion is not instance of ValidationRuleInterface'); |
56 | 56 | } |
57 | 57 | $module = $reflectionClass->newInstanceArgs([]); |