array
$defaultContext =
[],
) { parent::
__construct($classMetadataFactory,
$nameConverter,
$defaultContext);
if (isset($this->defaultContext
[self::MAX_DEPTH_HANDLER
]) && !\
is_callable($this->defaultContext
[self::MAX_DEPTH_HANDLER
])) { throw new InvalidArgumentException(sprintf('The "%s" given in the default context is not callable.', self::MAX_DEPTH_HANDLER
));
} $this->defaultContext
[self::EXCLUDE_FROM_CACHE_KEY
] =
array_merge($this->defaultContext
[self::EXCLUDE_FROM_CACHE_KEY
] ??
[],
[self::CIRCULAR_REFERENCE_LIMIT_COUNTERS
]);
if ($classMetadataFactory) { $classDiscriminatorResolver ??=
new ClassDiscriminatorFromClassMetadata($classMetadataFactory);
} $this->classDiscriminatorResolver =
$classDiscriminatorResolver;
$this->objectClassResolver =
($objectClassResolver ?? 'get_class'
)(...
);
} /**
* @param array $context
*
* @return bool
*/
public function supportsNormalization(mixed
$data, string
$format = null /* , array $context = [] */
) {