public function supportsNormalization(mixed
$data, string
$format = null /* , array $context = [] */
): bool
{ return $data instanceof \DateTimeZone;
} /**
* @throws NotNormalizableValueException
*/
public function denormalize(mixed
$data, string
$type, string
$format = null, array
$context =
[]): \DateTimeZone
{ if ('' ===
$data || null ===
$data) { throw NotNormalizableValueException::
createForUnexpectedDataType('The data is either an empty string or null, you should pass a string that can be parsed as a DateTimeZone.',
$data,
[Type::BUILTIN_TYPE_STRING
],
$context['deserialization_path'
] ?? null, true
);
} try { return new \
DateTimeZone($data);
} catch (\Exception
$e) { throw NotNormalizableValueException::
createForUnexpectedDataType($e->
getMessage(),
$data,
[Type::BUILTIN_TYPE_STRING
],
$context['deserialization_path'
] ?? null, true,
$e->
getCode(),
$e);
} } /**
* @param array $context
*/