[FEATURE] Use static instantiation with max depth check
This commit is contained in:
parent
ad37a28356
commit
78db0b9b63
|
@ -43,7 +43,7 @@ class Callback
|
||||||
|
|
||||||
public function serialize($object)
|
public function serialize($object)
|
||||||
{
|
{
|
||||||
$context = $this->serializer instanceof SerializerInterface ? new SerializationContext() : array();
|
$context = $this->serializer instanceof SerializerInterface ? SerializationContext::create()->enableMaxDepthChecks() : array();
|
||||||
|
|
||||||
if ($this->groups) {
|
if ($this->groups) {
|
||||||
$context->setGroups($this->groups);
|
$context->setGroups($this->groups);
|
||||||
|
|
Loading…
Reference in a new issue