x Sorry, these patches are not available anymore due to data migration. Please run a fresh inspection.
Passed
Push — master ( 731a27...4e7602 )
by Jesús
01:49
created
src/LaravelValidator.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,17 +48,22 @@
 block discarded – undo
48 48
         if ( is_string( $setOfRules ) || is_array( $setOfRules ) )
49 49
         {
50 50
             $validator = NULL;
51
-            if ( is_string( $setOfRules ) && method_exists( $this, $setOfRules ) ) $validator = $this->validator->make( $this->data, $this->{$setOfRules}() );
52
-            else if ( is_array( $setOfRules ) ) $validator = $this->validator->make( $this->data, $setOfRules );
53
-            else
51
+            if ( is_string( $setOfRules ) && method_exists( $this, $setOfRules ) ) {
52
+                $validator = $this->validator->make( $this->data, $this->{$setOfRules}() );
53
+            } else if ( is_array( $setOfRules ) ) {
54
+                $validator = $this->validator->make( $this->data, $setOfRules );
55
+            } else
54 56
             {
55 57
                 throw new ValidationFunctionDoesNotExist();
56 58
             }
57 59
 
58 60
             if ( !is_null( $validator ) )
59 61
             {
60
-                if( !$validator->fails() ) return TRUE;
61
-                else $this->errors = $validator->messages()->getMessages();
62
+                if( !$validator->fails() ) {
63
+                    return TRUE;
64
+                } else {
65
+                    $this->errors = $validator->messages()->getMessages();
66
+                }
62 67
             }
63 68
         }
64 69
 
Please login to merge, or discard this patch.