Passed
Push — master ( 5d30f6...461084 )
by Alexey
02:28
created
src/Validations/DateBeforeValidation.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@
 block discarded – undo
17 17
         return $valueTime < $targetTime;
18 18
     }
19 19
 
20
-    protected function getDateForCompare(){
21
-        if(isset($this->options[0]) ) return $this->options[0];
20
+    protected function getDateForCompare() {
21
+        if (isset($this->options[0])) return $this->options[0];
22 22
     }
23 23
 
24 24
     public function errorMessage()
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,9 @@
 block discarded – undo
18 18
     }
19 19
 
20 20
     protected function getDateForCompare(){
21
-        if(isset($this->options[0]) ) return $this->options[0];
21
+        if(isset($this->options[0]) ) {
22
+            return $this->options[0];
23
+        }
22 24
     }
23 25
 
24 26
     public function errorMessage()
Please login to merge, or discard this patch.
src/Validations/DateValidation.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
             $dateObj = DateTime::createFromFormat($this->options[0], $data->value());
17 17
             return $dateObj && $dateObj->format($this->options[0]) === $data->value();
18 18
         }
19
-       return strtotime($data->value()) > 0;
19
+        return strtotime($data->value()) > 0;
20 20
     }
21 21
 
22 22
     protected function afterSuccessValidation()
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 {
12 12
     public function isValid(ValueObject $data)
13 13
     {
14
-        if( ! is_string($data->value()) ) return false;
15
-        if(isset($this->options[0])){
14
+        if (!is_string($data->value())) return false;
15
+        if (isset($this->options[0])) {
16 16
             $dateObj = DateTime::createFromFormat($this->options[0], $data->value());
17 17
             return $dateObj && $dateObj->format($this->options[0]) === $data->value();
18 18
         }
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
     public function errorMessage()
29 29
     {
30
-        if(isset($this->options[0]))   return "{$this->data->name()} is not in date format {$this->options[0]}";
30
+        if (isset($this->options[0]))   return "{$this->data->name()} is not in date format {$this->options[0]}";
31 31
 
32 32
         return "{$this->data->name()} must be a valid date";
33 33
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,9 @@  discard block
 block discarded – undo
11 11
 {
12 12
     public function isValid(ValueObject $data)
13 13
     {
14
-        if( ! is_string($data->value()) ) return false;
14
+        if( ! is_string($data->value()) ) {
15
+            return false;
16
+        }
15 17
         if(isset($this->options[0])){
16 18
             $dateObj = DateTime::createFromFormat($this->options[0], $data->value());
17 19
             return $dateObj && $dateObj->format($this->options[0]) === $data->value();
@@ -27,7 +29,9 @@  discard block
 block discarded – undo
27 29
 
28 30
     public function errorMessage()
29 31
     {
30
-        if(isset($this->options[0]))   return "{$this->data->name()} is not in date format {$this->options[0]}";
32
+        if(isset($this->options[0])) {
33
+            return "{$this->data->name()} is not in date format {$this->options[0]}";
34
+        }
31 35
 
32 36
         return "{$this->data->name()} must be a valid date";
33 37
     }
Please login to merge, or discard this patch.
src/Validations/DateAfterValidation.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
         return $valueTime > $targetTime;
17 17
     }
18 18
 
19
-    protected function getDateForCompare(){
20
-        if(isset($this->options[0]) ) return $this->options[0];
19
+    protected function getDateForCompare() {
20
+        if (isset($this->options[0])) return $this->options[0];
21 21
     }
22 22
 
23 23
     protected function errorMessage()
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,9 @@
 block discarded – undo
17 17
     }
18 18
 
19 19
     protected function getDateForCompare(){
20
-        if(isset($this->options[0]) ) return $this->options[0];
20
+        if(isset($this->options[0]) ) {
21
+            return $this->options[0];
22
+        }
21 23
     }
22 24
 
23 25
     protected function errorMessage()
Please login to merge, or discard this patch.
src/Validations/FloatValidation.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,9 @@
 block discarded – undo
14 14
 
15 15
     public function isValid(ValueObject $data)
16 16
     {
17
-        if (is_bool($data->value())) return false;
17
+        if (is_bool($data->value())) {
18
+            return false;
19
+        }
18 20
         return is_float($data->value()) || preg_match('/^[\d\.]+$/', $data->value());
19 21
     }
20 22
 
Please login to merge, or discard this patch.
src/Validations/DateBetweenValidation.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
         $targetStartTime = strtotime($this->options[0]);
15 15
         $targetEndTime = strtotime($this->options[1]);
16 16
 
17
-        return ( $valueTime > $targetStartTime ) && ( $valueTime < $targetEndTime);
17
+        return ($valueTime > $targetStartTime) && ($valueTime < $targetEndTime);
18 18
     }
19 19
 
20 20
     public function errorMessage()
Please login to merge, or discard this patch.
src/Validations/AbstractValidation.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,9 @@
 block discarded – undo
43 43
 
44 44
     public function getErrorMessage()
45 45
     {
46
-        if (!is_null($this->errorMessage)) return str_replace("{name}", $this->data->name(), $this->errorMessage);
46
+        if (!is_null($this->errorMessage)) {
47
+            return str_replace("{name}", $this->data->name(), $this->errorMessage);
48
+        }
47 49
 
48 50
         return $this->errorMessage();
49 51
     }
Please login to merge, or discard this patch.