use Symfony\Component\DependencyInjection\Definition; $definition = new Definition(); $definition->setClass('My\Custom\Service'); $definition->setArguments(['argument1', 'argument2']);
use Symfony\Component\DependencyInjection\Definition; $definition = new Definition(); $definition->setClass('My\Custom\Service'); $definition->setArguments(['argument1', 'argument2']); $definition->setMethodCalls([ ['setLogger', ['@logger']], ['setMailer', ['@mailer']], ]);
use Symfony\Component\DependencyInjection\Definition; $definition = new Definition(); $definition->setClass('My\Custom\Service'); $definition->addTag('my_custom_tag');This adds a tag to the custom service definition. Tags are used to group services together so that they can be used in conjunction with other services or as part of a larger functionality. The Symfony\Component\DependencyInjection\Definition class is part of the Symfony Dependency Injection component library.