Completed
Push — master ( fb3047...828efc )
by Rafael
02:41
created
src/Array2Object.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             $props_arr[$f] = $prop;
86 86
         }
87 87
         if ($parentClass = $refClass->getParentClass()) {
88
-            $parent_props_arr = self::getClassProperties($parentClass);//RECURSION
88
+            $parent_props_arr = self::getClassProperties($parentClass); //RECURSION
89 89
             if (count($parent_props_arr) > 0) {
90 90
                 $props_arr = array_merge($parent_props_arr, $props_arr);
91 91
             }
@@ -129,15 +129,15 @@  discard block
 block discarded – undo
129 129
 
130 130
             switch ($type) {
131 131
                 case 'string':
132
-                    $value = (string)$value;
132
+                    $value = (string) $value;
133 133
                     break;
134 134
                 case 'integer':
135 135
                 case 'int':
136
-                    $value = (integer)$value;
136
+                    $value = (integer) $value;
137 137
                     break;
138 138
                 case 'float':
139 139
                 case 'double':
140
-                    $value = (float)$value;
140
+                    $value = (float) $value;
141 141
                     break;
142 142
                 case 'bool':
143 143
                 case 'boolean':
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                     } elseif (is_string($value) && strtolower($value) === 'true') {
147 147
                         $value = true;
148 148
                     } else {
149
-                        $value = (boolean)$value;
149
+                        $value = (boolean) $value;
150 150
                     }
151 151
                     break;
152 152
                 case '\DateTime':
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
         }
204 204
 
205 205
         //use the same namespace as class container
206
-        if ($className === null && class_exists($context->getNamespaceName() . "\\" . $type)) {
207
-            $className = $context->getNamespaceName() . "\\" . $type;
206
+        if ($className === null && class_exists($context->getNamespaceName()."\\".$type)) {
207
+            $className = $context->getNamespaceName()."\\".$type;
208 208
         }
209 209
 
210 210
         if (is_array($value) && $className !== null && class_exists($className)) {
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                 $newValue = [];
214 214
                 foreach ($value as $key => $item) {
215 215
                     if (is_array($item)) {
216
-                        $newValue[$key] = self::createObject($className, $value);;
216
+                        $newValue[$key] = self::createObject($className, $value); ;
217 217
                     } else {
218 218
                         $newValue[$key] = $item;
219 219
                     }
Please login to merge, or discard this patch.