Completed
Push — master ( 886f18...8ace16 )
by Alexey
02:25
created
src/Validations/IntValidation.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@
 block discarded – undo
21 21
 
22 22
     protected function isIntValue($value)
23 23
     {
24
-        if (is_bool($value)) return false;
24
+        if (is_bool($value)) {
25
+            return false;
26
+        }
25 27
         return is_int($value) || preg_match('/^\d+$/', $value);
26 28
     }
27 29
 }
28 30
\ No newline at end of file
Please login to merge, or discard this patch.
src/Validations/ValidationFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
         $options = explode(':', $validation);
38 38
         $validationName = array_shift($options);
39 39
         if (!array_key_exists($validationName, $this->map)) {
40
-            throw new InvalidValidationNameException('unknown validation name ' . $validationName);
40
+            throw new InvalidValidationNameException('unknown validation name '.$validationName);
41 41
         }
42 42
         return new $this->map[$validationName]($options);
43 43
     }
Please login to merge, or discard this patch.
src/DataProvider.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
             $name = $key;
24 24
             $alias = $key;
25 25
         }
26
-        if (!isset($this->data[$name])) return new NullValueObject($name, null);
26
+        if (!isset($this->data[$name])) {
27
+            return new NullValueObject($name, null);
28
+        }
27 29
 
28 30
         $value = new ValueObject($name, $this->data[$name]);
29 31
         $value->setAlias($alias);
Please login to merge, or discard this patch.
src/ValueObject.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
     public function setType($type)
34 34
     {
35
-        if (!in_array($type, $this->types())) throw new ValueObjectInvalidTypeException('Wrong type: ' . $type);
35
+        if (!in_array($type, $this->types())) throw new ValueObjectInvalidTypeException('Wrong type: '.$type);
36 36
         $this->type = $type;
37 37
     }
38 38
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,9 @@
 block discarded – undo
32 32
 
33 33
     public function setType($type)
34 34
     {
35
-        if (!in_array($type, $this->types())) throw new ValueObjectInvalidTypeException('Wrong type: ' . $type);
35
+        if (!in_array($type, $this->types())) {
36
+            throw new ValueObjectInvalidTypeException('Wrong type: ' . $type);
37
+        }
36 38
         $this->type = $type;
37 39
     }
38 40
 
Please login to merge, or discard this patch.
src/Validations/ArrayValidation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
     public function validate(ValueObject $data)
14 14
     {
15
-        if ( !is_array($data->value()) ) {
15
+        if (!is_array($data->value())) {
16 16
             $this->error = "{$data->name()} must be an array";
17 17
             return false;
18 18
         }
Please login to merge, or discard this patch.
src/Validations/StringValidation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
     public function validate(ValueObject $data)
15 15
     {
16
-        if ( !is_string($data->value()) ) {
16
+        if (!is_string($data->value())) {
17 17
             $this->error = "{$data->name()} must be a string";
18 18
             return false;
19 19
         }
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
@@ -23,7 +23,9 @@
 block discarded – undo
23 23
 
24 24
     protected function isFloatValue($value)
25 25
     {
26
-        if (is_bool($value)) return false;
26
+        if (is_bool($value)) {
27
+            return false;
28
+        }
27 29
         return is_float($value) || preg_match('/^[\d\.]+$/', $value);
28 30
     }
29 31
 
Please login to merge, or discard this patch.