Completed
Push — master ( 46c7bb...4858ea )
by Arthur
02:48
created
src/Concerns/ResolveCasting.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,16 +21,18 @@
 block discarded – undo
21 21
 
22 22
     private function processCasting(Attribute $attribute, $value)
23 23
     {
24
-        if (($castFunction = $attribute->getCast()) !== null && is_callable($castFunction))
25
-            return $castFunction($value);
24
+        if (($castFunction = $attribute->getCast()) !== null && is_callable($castFunction)) {
25
+                    return $castFunction($value);
26
+        }
26 27
 
27 28
         if ((($type = $attribute->getCast()) !== null && is_string($type)) ||
28 29
             (is_string($type = $attribute->cast(null)) && in_array(strtolower($type), ["bool", "boolean", "string", "double", "float", "int", "integer", "array", "object"]))) {
29 30
             return $this->castFromString($type, $value);
30 31
         }
31 32
 
32
-        if (!($attribute->cast(null) instanceof Attribute))
33
-            return $attribute->cast($value);
33
+        if (!($attribute->cast(null) instanceof Attribute)) {
34
+                    return $attribute->cast($value);
35
+        }
34 36
 
35 37
         return $value;
36 38
     }
Please login to merge, or discard this patch.
src/Attribute.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,8 +54,9 @@
 block discarded – undo
54 54
 
55 55
     public function cast($cast)
56 56
     {
57
-        if (is_callable($cast) || is_string($cast))
58
-            $this->cast = $cast;
57
+        if (is_callable($cast) || is_string($cast)) {
58
+                    $this->cast = $cast;
59
+        }
59 60
 
60 61
         return $this;
61 62
     }
Please login to merge, or discard this patch.