Passed
Push — master ( c44284...d7baa1 )
by Alexey
02:43
created
src/Validations/AbstractValidation.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 
20 20
     public function __construct($options = null)
21 21
     {
22
-        if(!is_null($options) && !is_array($options) ) $options = [$options];
22
+        if (!is_null($options) && !is_array($options)) $options = [$options];
23 23
         $this->options = $options;
24 24
     }
25 25
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,9 @@  discard block
 block discarded – undo
19 19
 
20 20
     public function __construct($options = null)
21 21
     {
22
-        if(!is_null($options) && !is_array($options) ) $options = [$options];
22
+        if(!is_null($options) && !is_array($options) ) {
23
+            $options = [$options];
24
+        }
23 25
         $this->options = $options;
24 26
     }
25 27
 
@@ -44,7 +46,9 @@  discard block
 block discarded – undo
44 46
 
45 47
     public function getErrorMessage()
46 48
     {
47
-        if (!is_null($this->errorMessage)) return str_replace("{name}", $this->data->name(), $this->errorMessage);
49
+        if (!is_null($this->errorMessage)) {
50
+            return str_replace("{name}", $this->data->name(), $this->errorMessage);
51
+        }
48 52
 
49 53
         return $this->errorMessage();
50 54
     }
Please login to merge, or discard this patch.
src/Validations/InValidation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 
16 16
     protected function errorMessage()
17 17
     {
18
-        return "{$this->data->name()} is not in (" . print_r($this->options[0],true) .")";
18
+        return "{$this->data->name()} is not in (".print_r($this->options[0], true).")";
19 19
     }
20 20
 
21 21
 }
22 22
\ No newline at end of file
Please login to merge, or discard this patch.
src/Rule.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
                 $validation = $validationFactory->get($key);
30 30
                 $validation->setErrorMessage($val);
31 31
             } else {
32
-                if($this->isCachedValidation($val)){
32
+                if ($this->isCachedValidation($val)) {
33 33
                     $validation = $this->validationCache[$val];
34 34
                 } else {
35 35
                     $validation = $validationFactory->get($val);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 
69 69
             }
70 70
             return $signatures;
71
-        } elseif ($options instanceof AbstractValidation){
71
+        } elseif ($options instanceof AbstractValidation) {
72 72
             return [$this->addToCache($options)];
73 73
         }
74 74
 
@@ -158,13 +158,13 @@  discard block
 block discarded – undo
158 158
         return array_unique($this->errors);
159 159
     }
160 160
 
161
-    protected function addToCache(AbstractValidation $validation){
162
-        $key = '__cache__' . sizeof($this->validationCache);
161
+    protected function addToCache(AbstractValidation $validation) {
162
+        $key = '__cache__'.sizeof($this->validationCache);
163 163
         $this->validationCache[$key] = $validation;
164 164
         return $key;
165 165
     }
166 166
 
167
-    protected function isCachedValidation($name){
167
+    protected function isCachedValidation($name) {
168 168
         return array_key_exists($name, $this->validationCache);
169 169
     }
170 170
 
Please login to merge, or discard this patch.