Always list the class of an object first

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2021-08-05 15:00:41 +02:00
parent 950de74d1d
commit b235a854d3
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF

View file

@ -237,11 +237,11 @@ class ExceptionSerializer {
];
}
$data = get_object_vars($arg);
$data['__class__'] = get_class($arg);
$objectInfo = [ '__class__' => get_class($arg) ];
$objectVars = get_object_vars($arg);
return array_map(function ($arg) use ($nestingLevel) {
return $this->encodeArg($arg, $nestingLevel - 1);
}, $data);
}, array_merge($objectInfo, $objectVars));
}
if (is_array($arg)) {