use PriorityTaggedServiceTrait;
/**
* @return void
*/
public function process(ContainerBuilder
$container) { if (!
$container->
hasDefinition('serializer'
)) { return;
} if (!
$normalizers =
$this->
findAndSortTaggedServices('serializer.normalizer',
$container)) { throw new RuntimeException('You must tag at least one service as "serializer.normalizer" to use the "serializer" service.'
);
} if (!
$encoders =
$this->
findAndSortTaggedServices('serializer.encoder',
$container)) { throw new RuntimeException('You must tag at least one service as "serializer.encoder" to use the "serializer" service.'
);
} if ($container->
hasParameter('serializer.default_context'
)) { $defaultContext =
$container->
getParameter('serializer.default_context'
);
foreach (array_merge($normalizers,
$encoders) as $service) { $definition =
$container->
getDefinition($service);