@@ -1,4 +1,4 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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,7 +164,7 @@ discard block |
||
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 | return $this->dehydrateNode( |
169 | 169 | $value, |
170 | 170 | $schema instanceof ArraySchema ? $schema->getItemsSchema() : $this->anySchema |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | }, $node); |
173 | 173 | } elseif ($this->shouldTreatAsObject($node, $schema)) { |
174 | 174 | $input = $node; |
175 | - $node = (object)[]; |
|
175 | + $node = (object)[ ]; |
|
176 | 176 | |
177 | 177 | if (!$input instanceof \stdClass) { |
178 | 178 | $input = $this->extractValuesFromTypedObject($input); |
@@ -291,10 +291,10 @@ discard block |
||
291 | 291 | { |
292 | 292 | $reflector = new \ReflectionObject($node); |
293 | 293 | $properties = $reflector->getProperties(); |
294 | - $data = []; |
|
294 | + $data = [ ]; |
|
295 | 295 | foreach ($properties as $attribute) { |
296 | 296 | $attribute->setAccessible(true); |
297 | - $data[$attribute->getName()] = $attribute->getValue($node); |
|
297 | + $data[ $attribute->getName() ] = $attribute->getValue($node); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | return $data; |