Completed
Push — master ( df2fdb...638b8d )
by John
01:34
created
src/ObjectHydrator.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 /*
3 3
  * This file is part of the KleijnWeb\PhpApi\Hydrator package.
4 4
  *
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
 
93 93
         if ($schema instanceof AnySchema) {
94 94
             if (is_array($node)) {
95
-                return array_map(function ($value) use ($schema) {
95
+                return array_map(function($value) use ($schema) {
96 96
                     return $this->hydrateNode($value, $this->anySchema);
97 97
                 }, $node);
98 98
             } elseif (is_object($node)) {
99
-                $object = (object)[];
99
+                $object = (object)[ ];
100 100
                 foreach ($node as $property => $value) {
101 101
                     $object->$property = $this->hydrateNode($value, $this->anySchema);
102 102
                 }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             }
114 114
 
115 115
         } elseif ($schema instanceof ArraySchema) {
116
-            return array_map(function ($value) use ($schema) {
116
+            return array_map(function($value) use ($schema) {
117 117
                 return $this->hydrateNode($value, $schema->getItemsSchema());
118 118
             }, $node);
119 119
         } elseif ($schema instanceof ObjectSchema) {
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
                 return $object;
129 129
             }
130
-            $fqcn = $this->classNameResolver->resolve($schema->getComplexType()->getName());;
130
+            $fqcn = $this->classNameResolver->resolve($schema->getComplexType()->getName()); ;
131 131
             $object    = unserialize(sprintf('O:%d:"%s":0:{}', strlen($fqcn), $fqcn));
132 132
             $reflector = new \ReflectionObject($object);
133 133
 
@@ -164,14 +164,14 @@  discard block
 block discarded – undo
164 164
         if ($node instanceof \DateTimeInterface) {
165 165
             $node = $this->dateTimeSerializer->serialize($node, $schema);
166 166
         } elseif ($this->shouldTreatAsArray($node, $schema)) {
167
-            $node = array_map(function ($value) use ($schema) {
167
+            $node = array_map(function($value) use ($schema) {
168 168
                 $schema = $schema instanceof ArraySchema ? $schema->getItemsSchema() : $this->anySchema;
169 169
 
170 170
                 return $this->dehydrateNode($value, $schema);
171 171
             }, $node);
172 172
         } elseif ($this->shouldTreatAsObject($node, $schema)) {
173 173
             $input = $node;
174
-            $node  = (object)[];
174
+            $node  = (object)[ ];
175 175
 
176 176
             if (!$input instanceof \stdClass) {
177 177
                 $input = $this->extractValuesFromTypedObject($input);
@@ -290,10 +290,10 @@  discard block
 block discarded – undo
290 290
     {
291 291
         $reflector  = new \ReflectionObject($node);
292 292
         $properties = $reflector->getProperties();
293
-        $data       = [];
293
+        $data       = [ ];
294 294
         foreach ($properties as $attribute) {
295 295
             $attribute->setAccessible(true);
296
-            $data[$attribute->getName()] = $attribute->getValue($node);
296
+            $data[ $attribute->getName() ] = $attribute->getValue($node);
297 297
         }
298 298
 
299 299
         return $data;
Please login to merge, or discard this patch.