<?php

namespace AutoAdmin\Bundle\Admin\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class ControllerCompilerPass implements CompilerPassInterface
{
    public function process(ContainerBuilder $container): void
    {
        $extraConfigServices = $container->findTaggedServiceIds('aa_admin.controller');
        foreach ($extraConfigServices as $id => $value) {
            $def = $container->getDefinition($id);
            if (!$def->hasTag('controller.service_arguments')) {
                $def->addTag('controller.service_arguments');
            }
        }
    }
}
