public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('sylius.registry.grid_field')) {
return;
}
$registry = $container->getDefinition('sylius.registry.grid_field');
foreach ($container->findTaggedServiceIds('sylius.grid_field') as $id => $attributes) {
if (!isset($attributes[0]['type'])) {
throw new \InvalidArgumentException('Tagged grid fields needs to have `type` attribute.');
}
$registry->addMethodCall('register', [$attributes[0]['type'], new Reference($id)]);
}
}