&&
$this->serializer instanceof NormalizerInterface
&&
$this->serializer->
supportsNormalization($exception->
getViolations(),
$format,
$context) ) { $data =
$this->serializer->
normalize($exception->
getViolations(),
$format,
$context);
} } $data =
[ self::TYPE =>
$data[self::TYPE
] ??
$context[self::TYPE
] ?? 'https://tools.ietf.org/html/rfc2616#section-10',
self::TITLE =>
$data[self::TITLE
] ??
$context[self::TITLE
] ?? 'An error occurred',
self::STATUS =>
$context[self::STATUS
] ??
$object->
getStatusCode(),
'detail' =>
$data['detail'
] ?? ($debug ?
$object->
getMessage() :
$object->
getStatusText()),
] +
$data;
if ($debug) { $data['class'
] =
$object->
getClass();
$data['trace'
] =
$object->
getTrace();
} return $data;
} /**
* @param array $context
*/