forked from loafle/openapi-generator-original
[PHP-SYMFONY] Debug Symfony version 7, enums ref, array of enums $ref and date assert (#19008)
* [PHP-SYMFONY] Debug for Symfony 7 support & debug enum ref & debug array enum ref & debug date assert * [PHP-SYMFONY] Debug for Symfony 7 support & debug enum ref & debug array enum ref & debug date assert * [PHP-SYMFONY] Debug for Symfony 7 support & debug enum ref & debug array enum ref & debug date assert
This commit is contained in:
@@ -101,12 +101,16 @@ class JmsSerializer implements SerializerInterface
|
||||
case '\DateTime':
|
||||
return is_null($data) ? null :new DateTime($data);
|
||||
default:
|
||||
if (is_null($data)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!class_exists($type)) {
|
||||
throw new RuntimeException(sprintf("Type %s is unsupported", $type));
|
||||
}
|
||||
|
||||
$reflectionClass = new \ReflectionClass($type);
|
||||
if (!$reflectionClass->implementsInterface('\BackedENum')) {
|
||||
if (!$reflectionClass->implementsInterface('\BackedEnum')) {
|
||||
throw new RuntimeException(sprintf("Type %s is unsupported", $type));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user