private readonly \Closure
$objectClassResolver;
public function __construct(ClassMetadataFactoryInterface
$classMetadataFactory = null, NameConverterInterface
$nameConverter = null, PropertyAccessorInterface
$propertyAccessor = null, PropertyTypeExtractorInterface
$propertyTypeExtractor = null, ClassDiscriminatorResolverInterface
$classDiscriminatorResolver = null, callable
$objectClassResolver = null, array
$defaultContext =
[]) { if (!
class_exists(PropertyAccess::
class)) { throw new LogicException('The ObjectNormalizer class requires the "PropertyAccess" component. Try running "composer require symfony/property-access".'
);
} parent::
__construct($classMetadataFactory,
$nameConverter,
$propertyTypeExtractor,
$classDiscriminatorResolver,
$objectClassResolver,
$defaultContext);
$this->propertyAccessor =
$propertyAccessor ?: PropertyAccess::
createPropertyAccessor();
$this->objectClassResolver =
($objectClassResolver ??
static fn ($class) => \
is_object($class) ?
$class::
class D
$class)(...
);
} public function getSupportedTypes(?string
$format): array
{ return ['object' => __CLASS__ ===
static::
class || $this->
hasCacheableSupportsMethod()];
} /**
* @deprecated since Symfony 6.3, use "getSupportedTypes()" instead
*/