use Symfony\Component\DependencyInjection\ContainerBuilder; $container = new ContainerBuilder(); $container->register('old_service_name', MyService::class); $container->setAlias('new_service_name', 'old_service_name');
use Symfony\Component\DependencyInjection\ContainerBuilder; $container = new ContainerBuilder(); $container->setParameter('old_parameter_name', 'old_value'); $container->setAlias('new_parameter_name', 'old_parameter_name');In this example, we set a parameter with the old name, and then create an alias for it with the new name. This is useful when you want to rename a parameter that is used in multiple places throughout your codebase. The Symfony\Component\DependencyInjection package library provides the ContainerBuilder class and other classes for working with dependency injection in Symfony applications.