Symfony的(FrameworkBundle v4.2.5)序列化程序组件(v4.2.5)现在在日志中告诉我:
php.INFO: User Deprecated: The "Symfony\Component\Serializer\Normalizer\AbstractNormalizer::setCircularReferenceHandler()" method is deprecated since Symfony 4.2, use the "circular_reference_handler" key of the context instead.
但事实是,我没有明确调用此方法。该调用实际上是由SymfonyFrameworkBundle触发的。
我在我的framework.yaml中有它:
serializer:
enabled: true
circular_reference_handler: Cbp\Utils\CircularReferenceHandler
我在FrameworkExtension(由FrameworkBundle提供)中看到了这一点:
if (isset($config['circular_reference_handler']) && $config['circular_reference_handler']) {
$container->getDefinition('serializer.normalizer.object')->addMethodCall('setCircularReferenceHandler', [new Reference($config['circular_reference_handler'])]);
}
所以我的问题是:我该如何解决此弃用通知?