Passed
Push — master ( 5efbd8...fe98a2 )
by farhad
59s queued 10s
created
src/Contracts/AbstractValidationRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
src/Rules/IsNotPersian.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
         if (is_string($value)) {
15 15
             $this->status = (bool) preg_match("/[\x{600}-\x{6FF}]/u", $value);
16 16
 
17
-            return ! $this->status;
17
+            return !$this->status;
18 18
         }
19 19
 
20 20
         return false;
Please login to merge, or discard this patch.
src/Rules/CardNumber.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 
12 12
     public function rule($attribute, $value, $parameters, $validator): bool
13 13
     {
14
-        if (! preg_match('/^\d{16}$/', $value)) {
14
+        if (!preg_match('/^\d{16}$/', $value)) {
15 15
             return false;
16 16
         }
17 17
         $sum = 0;
Please login to merge, or discard this patch.
src/Rules/MelliCode.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,14 +11,14 @@
 block discarded – undo
11 11
 
12 12
     public function rule($attribute, $value, $parameters, $validator): bool
13 13
     {
14
-        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)) {
14
+        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)) {
15 15
             return false;
16 16
         }
17 17
         $sub = 0;
18 18
         if (strlen($value) == 8) {
19
-            $value = '00'.$value;
19
+            $value = '00' . $value;
20 20
         } elseif (strlen($value) == 9) {
21
-            $value = '0'.$value;
21
+            $value = '0' . $value;
22 22
         }
23 23
 
24 24
         for ($i = 0; $i <= 8; $i++) {
Please login to merge, or discard this patch.
src/Rules/ShebaNumber.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@
 block discarded – undo
18 18
         }
19 19
 
20 20
         $value = preg_replace('/[\W_]+/', '', strtoupper($value));
21
-        if ((4 > strlen($value) || strlen($value) > 34) || (is_numeric($value[0]) || is_numeric($value[1])) || (! is_numeric($value[2]) || ! is_numeric($value[3]))) {
21
+        if ((4 > strlen($value) || strlen($value) > 34) || (is_numeric($value[0]) || is_numeric($value[1])) || (!is_numeric($value[2]) || !is_numeric($value[3]))) {
22 22
             return false;
23 23
         }
24 24
         $ibanReplaceChars = range('A', 'Z');
25 25
         foreach (range(10, 35) as $tempvalue) {
26 26
             $ibanReplaceValues[] = strval($tempvalue);
27 27
         }
28
-        $tmpIBAN = substr($value, 4).substr($value, 0, 4);
28
+        $tmpIBAN = substr($value, 4) . substr($value, 0, 4);
29 29
         $tmpIBAN = str_replace($ibanReplaceChars, $ibanReplaceValues, $tmpIBAN);
30 30
         $tmpValue = intval(substr($tmpIBAN, 0, 1));
31 31
         for ($i = 1; $i < strlen($tmpIBAN); $i++) {
Please login to merge, or discard this patch.
src/ValidationMessages.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@
 block discarded – undo
19 19
 
20 20
     public function __construct()
21 21
     {
22
-        $app_lang = resource_path('lang/validation/'.App::getLocale().'.php');
22
+        $app_lang = resource_path('lang/validation/' . App::getLocale() . '.php');
23 23
 
24
-        if (! file_exists($app_lang)) {
24
+        if (!file_exists($app_lang)) {
25 25
             $this->lang = include $app_lang;
26 26
         } else {
27
-            $this->lang = include __DIR__.'/lang/validation/'.App::getLocale().'.php';
27
+            $this->lang = include __DIR__ . '/lang/validation/' . App::getLocale() . '.php';
28 28
         }
29 29
     }
30 30
 
Please login to merge, or discard this patch.
src/ValidationServiceProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
     public function boot()
38 38
     {
39 39
         $this->publishes([
40
-            __DIR__.'/lang/validation/'.App::getLocale().'.php' => resource_path('lang/validation/'.App::getLocale().'.php'),
40
+            __DIR__ . '/lang/validation/' . App::getLocale() . '.php' => resource_path('lang/validation/' . App::getLocale() . '.php'),
41 41
         ]);
42 42
 
43
-        foreach (glob(__DIR__.'/Rules/*.php') as $file) {
43
+        foreach (glob(__DIR__ . '/Rules/*.php') as $file) {
44 44
             require_once $file;
45 45
 
46 46
             // get the file name of the current file without the extension
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
             $class = basename($file, '.php');
49 49
 
50 50
             $Rule = 'Iamfarhad\Validation\Rules';
51
-            if (class_exists($Rule.'\\'.$class)) {
52
-                $reflectionClass = new \ReflectionClass($Rule.'\\'.$class);
53
-                if (! $reflectionClass->isInstance((object) AbstractValidationRule::class)) {
51
+            if (class_exists($Rule . '\\' . $class)) {
52
+                $reflectionClass = new \ReflectionClass($Rule . '\\' . $class);
53
+                if (!$reflectionClass->isInstance((object) AbstractValidationRule::class)) {
54 54
                     throw new \Exception('this extenstion is not instance of ValidationRuleInterface');
55 55
                 }
56 56
                 $module = $reflectionClass->newInstanceArgs([]);
Please login to merge, or discard this patch.