@@ -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 | * |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | /** |
24 | 24 | * @var \ReflectionProperty[] |
25 | 25 | */ |
26 | - protected $reflectionProperties = []; |
|
26 | + protected $reflectionProperties = [ ]; |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * @var string |
@@ -38,26 +38,26 @@ discard block |
||
38 | 38 | |
39 | 39 | foreach ($this->reflector->getProperties() as $reflectionProperty) { |
40 | 40 | $reflectionProperty->setAccessible(true); |
41 | - $this->reflectionProperties[$reflectionProperty->getName()] = $reflectionProperty; |
|
41 | + $this->reflectionProperties[ $reflectionProperty->getName() ] = $reflectionProperty; |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | 45 | |
46 | 46 | protected function dehydrateObject($object): \stdClass |
47 | 47 | { |
48 | - $node = (object)[]; |
|
48 | + $node = (object)[ ]; |
|
49 | 49 | |
50 | 50 | /** @var ObjectSchema $objectSchema */ |
51 | 51 | $objectSchema = $this->schema; |
52 | 52 | |
53 | 53 | foreach ($objectSchema->getPropertySchemas() as $name => $propertySchema) { |
54 | - if (!isset($this->reflectionProperties[$name])) { |
|
55 | - if (!isset($this->defaults[$name])) { |
|
54 | + if (!isset($this->reflectionProperties[ $name ])) { |
|
55 | + if (!isset($this->defaults[ $name ])) { |
|
56 | 56 | continue; |
57 | 57 | } |
58 | - $value = $this->defaults[$name]; |
|
58 | + $value = $this->defaults[ $name ]; |
|
59 | 59 | } else { |
60 | - $value = $this->reflectionProperties[$name]->getValue($object); |
|
60 | + $value = $this->reflectionProperties[ $name ]->getValue($object); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | if ($this->shouldFilterOutputValue($objectSchema->getPropertySchema($name), $value)) { |