@@ 52-57 (lines=6) @@ | ||
49 | $reflectionClass = new \ReflectionClass(\get_class($arg)); |
|
50 | $serializedObject = \array_reduce( |
|
51 | $reflectionClass->getProperties(), |
|
52 | function ($carry, $property) use ($arg) { |
|
53 | /** @var \ReflectionProperty $property */ |
|
54 | $property->setAccessible(true); |
|
55 | $carry[$property->getName()] = $this->serializeItem($property->getValue($arg)); |
|
56 | return $carry; |
|
57 | }, |
|
58 | [] |
|
59 | ); |
|
60 | $parentClass = $reflectionClass->getParentClass(); |
|
@@ 64-69 (lines=6) @@ | ||
61 | if ($parentClass) { |
|
62 | $serializedParentObject = \array_reduce( |
|
63 | $parentClass->getProperties(), |
|
64 | function ($carry, $property) use ($arg) { |
|
65 | /** @var \ReflectionProperty $property */ |
|
66 | $property->setAccessible(true); |
|
67 | $carry[$property->getName()] = $this->serializeItem($property->getValue($arg)); |
|
68 | return $carry; |
|
69 | }, |
|
70 | [] |
|
71 | ); |
|
72 | $serializedObject = \array_merge($serializedObject, $serializedParentObject); |