Skip to content

Commit 8e673fe

Browse files
authored
Merge pull request #37 from xhuberty/5.2
Fix object properties conversion to array
2 parents a9e35d8 + 315c7a6 commit 8e673fe

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Mouf/Html/Widgets/EvoluGrid/Utils/ObjectToArrayCaster.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,7 @@ public function cast($object) : array
6464
throw new \InvalidArgumentException('Argument passed to cast must be an array or an object.');
6565
}
6666

67-
$arr = [];
68-
69-
foreach ($this->refClass->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
70-
$arr[$property->getName()] = $property->getValue($object);
71-
}
67+
$arr = get_object_vars($object);
7268

7369
foreach ($this->getters as $propertyName => $method) {
7470
$arr[$propertyName] = $method->invoke($object);

0 commit comments

Comments
 (0)