abstract_arg example

->args([
                service('webhook.transport'),
            ])
            ->tag('messenger.message_handler')

        ->set('webhook.request_parser', RequestParser::class)
        ->alias(RequestParser::class, 'webhook.request_parser')

        ->set('webhook.controller', WebhookController::class)
            ->public()
            ->args([
                abstract_arg('user defined parsers'),
                abstract_arg('message bus'),
            ])
    ;
};
use Symfony\Component\Security\Core\Signature\ExpiredSignatureStorage;
use Symfony\Component\Security\Core\Signature\SignatureHasher;
use Symfony\Component\Security\Http\Authenticator\LoginLinkAuthenticator;
use Symfony\Component\Security\Http\LoginLink\LoginLinkHandler;
use Symfony\Component\Security\Http\LoginLink\LoginLinkHandlerInterface;

return static function DContainerConfigurator $container) {
    $container->services()
        ->set('security.authenticator.login_link', LoginLinkAuthenticator::class)
            ->abstract()
            ->args([
                abstract_arg('the login link handler instance'),
                service('security.http_utils'),
                abstract_arg('authentication success handler'),
                abstract_arg('authentication failure handler'),
                abstract_arg('options'),
            ])

        ->set('security.authenticator.abstract_login_link_handler', LoginLinkHandler::class)
            ->abstract()
            ->args([
                service('router'),
                abstract_arg('user provider'),
                
->set('assets.context', RequestStackContext::class)
            ->args([
                service('request_stack'),
                param('asset.request_context.base_path'),
                param('asset.request_context.secure'),
            ])

        ->set('assets.path_package', PathPackage::class)
            ->abstract()
            ->args([
                abstract_arg('base path'),
                abstract_arg('version strategy'),
                service('assets.context'),
            ])

        ->set('assets.url_package', UrlPackage::class)
            ->abstract()
            ->args([
                abstract_arg('base URLs'),
                abstract_arg('version strategy'),
                service('assets.context'),
            ])

        
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Messenger\Transport\Sync\SyncTransportFactory;
use Symfony\Component\Messenger\Transport\TransportFactory;

return static function DContainerConfigurator $container) {
    $container->services()
        ->alias(SerializerInterface::class, 'messenger.default_serializer')

        // Asynchronous         ->set('messenger.senders_locator', SendersLocator::class)
            ->args([
                abstract_arg('per message senders map'),
                abstract_arg('senders service locator'),
            ])
        ->set('messenger.middleware.send_message', SendMessageMiddleware::class)
            ->abstract()
            ->args([
                service('messenger.senders_locator'),
                service('event_dispatcher'),
            ])
            ->call('setLogger', [service('logger')->ignoreOnInvalid()])
            ->tag('monolog.logger', ['channel' => 'messenger'])

        
->args([
                service('service_container'),
                service('logger')->ignoreOnInvalid(),
            ])
            ->tag('monolog.logger', ['channel' => 'request'])

        ->set('argument_metadata_factory', ArgumentMetadataFactory::class)

        ->set('argument_resolver', ArgumentResolver::class)
            ->args([
                service('argument_metadata_factory'),
                abstract_arg('argument value resolvers'),
                abstract_arg('targeted value resolvers'),
            ])

        ->set('argument_resolver.backed_enum_resolver', BackedEnumValueResolver::class)
            ->tag('controller.argument_value_resolver', ['priority' => 100, 'name' => BackedEnumValueResolver::class])

        ->set('argument_resolver.uid', UidValueResolver::class)
            ->tag('controller.argument_value_resolver', ['priority' => 100, 'name' => UidValueResolver::class])

        ->set('argument_resolver.datetime', DateTimeValueResolver::class)
            ->args([
                
->set('cache.scheduler')
            ->parent('cache.app')
            ->private()
            ->tag('cache.pool')

        ->set('cache.adapter.system', AdapterInterface::class)
            ->abstract()
            ->factory([AbstractAdapter::class, 'createSystemCache'])
            ->args([
                '', // namespace                 0, // default lifetime                 abstract_arg('version'),
                sprintf('%s/pools/system', param('kernel.cache_dir')),
                service('logger')->ignoreOnInvalid(),
            ])
            ->tag('cache.pool', ['clearer' => 'cache.system_clearer', 'reset' => 'reset'])
            ->tag('monolog.logger', ['channel' => 'cache'])

        ->set('cache.adapter.apcu', ApcuAdapter::class)
            ->abstract()
            ->args([
                '', // namespace                 0, // default lifetime
->args([
                service_locator([
                    'security.token_storage' => service('security.token_storage'),
                    'security.authorization_checker' => service('security.authorization_checker'),
                    'security.authenticator.managers_locator' => service('security.authenticator.managers_locator')->ignoreOnInvalid(),
                    'request_stack' => service('request_stack'),
                    'security.firewall.map' => service('security.firewall.map'),
                    'security.user_checker' => service('security.user_checker'),
                    'security.firewall.event_dispatcher_locator' => service('security.firewall.event_dispatcher_locator'),
                    'security.csrf.token_manager' => service('security.csrf.token_manager')->ignoreOnInvalid(),
                ]),
                abstract_arg('authenticators'),
            ])
        ->alias(Security::class, 'security.helper')
        ->alias(LegacySecurity::class, 'security.helper')
            ->deprecate('symfony/security-bundle', '6.2', 'The "%alias_id%" service alias is deprecated, use "'.Security::class.'" instead.')

        ->set('security.user_value_resolver', UserValueResolver::class)
            ->args([
                service('security.token_storage'),
            ])
            ->tag('controller.argument_value_resolver', ['priority' => 120, 'name' => UserValueResolver::class])

        
use Symfony\Component\Translation\Reader\TranslationReader;
use Symfony\Component\Translation\Reader\TranslationReaderInterface;
use Symfony\Component\Translation\Writer\TranslationWriter;
use Symfony\Component\Translation\Writer\TranslationWriterInterface;
use Symfony\Contracts\Translation\LocaleAwareInterface;
use Symfony\Contracts\Translation\TranslatorInterface;

return static function DContainerConfigurator $container) {
    $container->services()
        ->set('translator.default', Translator::class)
            ->args([
                abstract_arg('translation loaders locator'),
                service('translator.formatter'),
                param('kernel.default_locale'),
                abstract_arg('translation loaders ids'),
                [
                    'cache_dir' => param('kernel.cache_dir').'/translations',
                    'debug' => param('kernel.debug'),
                ],
                abstract_arg('enabled locales'),
            ])
            ->call('setConfigCacheFactory', [service('config_cache_factory')])
            ->tag('kernel.locale_aware')

        


namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\Semaphore\SemaphoreFactory;

return static function DContainerConfigurator $container) {
    $container->services()
        ->set('semaphore.factory.abstract', SemaphoreFactory::class)->abstract()
            ->args([abstract_arg('Store')])
            ->call('setLogger', [service('logger')->ignoreOnInvalid()])
            ->tag('monolog.logger', ['channel' => 'semaphore'])
    ;
};
use Symfony\Component\HttpClient\Psr18Client;
use Symfony\Component\HttpClient\Retry\GenericRetryStrategy;
use Symfony\Component\HttpClient\UriTemplateHttpClient;
use Symfony\Contracts\HttpClient\HttpClientInterface;

return static function DContainerConfigurator $container) {
    $container->services()
        ->set('http_client.transport', HttpClientInterface::class)
            ->factory([HttpClient::class, 'create'])
            ->args([
                [], // default options                 abstract_arg('max host connections'),
            ])
            ->call('setLogger', [service('logger')->ignoreOnInvalid()])
            ->tag('monolog.logger', ['channel' => 'http_client'])
            ->tag('kernel.reset', ['method' => 'reset', 'on_invalid' => 'ignore'])

        ->set('http_client', HttpClientInterface::class)
            ->factory('current')
            ->args([[service('http_client.transport')]])
            ->tag('http_client.client')

        ->alias(HttpClientInterface::class, 'http_client')

        


namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\Lock\LockFactory;
use Symfony\Component\Lock\Store\CombinedStore;
use Symfony\Component\Lock\Strategy\ConsensusStrategy;

return static function DContainerConfigurator $container) {
    $container->services()
        ->set('lock.store.combined.abstract', CombinedStore::class)->abstract()
            ->args([abstract_arg('List of stores')service('lock.strategy.majority')])

        ->set('lock.strategy.majority', ConsensusStrategy::class)

        ->set('lock.factory.abstract', LockFactory::class)->abstract()
            ->args([abstract_arg('Store')])
            ->call('setLogger', [service('logger')->ignoreOnInvalid()])
            ->tag('monolog.logger', ['channel' => 'lock'])
    ;
};
use Twig\ExtensionSet;
use Twig\Loader\ChainLoader;
use Twig\Loader\FilesystemLoader;
use Twig\Profiler\Profile;
use Twig\RuntimeLoader\ContainerRuntimeLoader;
use Twig\Template;
use Twig\TemplateWrapper;

return static function DContainerConfigurator $container) {
    $container->services()
        ->set('twig', Environment::class)
            ->args([service('twig.loader')abstract_arg('Twig options')])
            ->call('addGlobal', ['app', service('twig.app_variable')])
            ->call('addRuntimeLoader', [service('twig.runtime_loader')])
            ->configurator([service('twig.configurator.environment'), 'configure'])
            ->tag('container.preload', ['class' => FilesystemCache::class])
            ->tag('container.preload', ['class' => CoreExtension::class])
            ->tag('container.preload', ['class' => EscaperExtension::class])
            ->tag('container.preload', ['class' => OptimizerExtension::class])
            ->tag('container.preload', ['class' => StagingExtension::class])
            ->tag('container.preload', ['class' => ExtensionSet::class])
            ->tag('container.preload', ['class' => Template::class])
            ->tag('container.preload', ['class' => TemplateWrapper::class])

        
service('debug.stopwatch'),
            ])

        ->set('debug.argument_resolver', TraceableArgumentResolver::class)
            ->decorate('argument_resolver')
            ->args([
                service('debug.argument_resolver.inner'),
                service('debug.stopwatch'),
            ])

        ->set('argument_resolver.not_tagged_controller', NotTaggedControllerValueResolver::class)
            ->args([abstract_arg('Controller argument, set in FrameworkExtension')])
            ->tag('controller.argument_value_resolver', ['priority' => -200])
    ;
};


namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Bundle\FrameworkBundle\Secrets\DotenvVault;
use Symfony\Bundle\FrameworkBundle\Secrets\SodiumVault;

return static function DContainerConfigurator $container) {
    $container->services()
        ->set('secrets.vault', SodiumVault::class)
            ->args([
                abstract_arg('Secret dir, set in FrameworkExtension'),
                service('secrets.decryption_key')->ignoreOnInvalid(),
            ])
            ->tag('container.env_var_loader')

        ->set('secrets.decryption_key')
            ->parent('container.env')
            ->args([abstract_arg('Decryption env var, set in FrameworkExtension')])

        ->set('secrets.local_vault', DotenvVault::class)
            ->args([abstract_arg('.env file path, set in FrameworkExtension')])
    ;
};
->set('notifier.flash_message_importance_mapper', DefaultFlashMessageImportanceMapper::class)
            ->args([[]])

        ->set('notifier.channel.browser', BrowserChannel::class)
            ->args([service('request_stack')service('notifier.flash_message_importance_mapper')])
            ->tag('notifier.channel', ['channel' => 'browser'])

        ->set('notifier.channel.chat', ChatChannel::class)
            ->args([
                service('chatter.transports'),
                abstract_arg('message bus'),
            ])
            ->tag('notifier.channel', ['channel' => 'chat'])

        ->set('notifier.channel.sms', SmsChannel::class)
            ->args([
                service('texter.transports'),
                abstract_arg('message bus'),
            ])
            ->tag('notifier.channel', ['channel' => 'sms'])

        ->set('notifier.channel.email', EmailChannel::class)
            
Home | Imprint | This part of the site doesn't use cookies.