abstract example

->set('security.authenticator.remember_me_signature_hasher', SignatureHasher::class)
            ->args([
                service('property_accessor'),
                abstract_arg('signature properties'),
                '%kernel.secret%',
                null,
                null,
            ])

        ->set('security.authenticator.signature_remember_me_handler', SignatureRememberMeHandler::class)
            ->abstract()
            ->args([
                abstract_arg('signature hasher'),
                abstract_arg('user provider'),
                service('request_stack'),
                abstract_arg('options'),
                service('logger')->nullOnInvalid(),
            ])
            ->tag('monolog.logger', ['channel' => 'security'])

        ->set('security.authenticator.persistent_remember_me_handler', PersistentRememberMeHandler::class)
            ->abstract()
            
return static function DContainerConfigurator $container) {
    $container->services()
        ->set('workflow.abstract', Workflow::class)
            ->args([
                abstract_arg('workflow definition'),
                abstract_arg('marking store'),
                service('event_dispatcher')->ignoreOnInvalid(),
                abstract_arg('workflow name'),
                abstract_arg('events to dispatch'),
            ])
            ->abstract()
        ->set('state_machine.abstract', StateMachine::class)
            ->args([
                abstract_arg('workflow definition'),
                abstract_arg('marking store'),
                service('event_dispatcher')->ignoreOnInvalid(),
                abstract_arg('workflow name'),
                abstract_arg('events to dispatch'),
            ])
            ->abstract()
        ->set('workflow.marking_store.method', MethodMarkingStore::class)
            ->abstract()
        
$di->load(Prototype::class.'\\', '../Prototype')
        ->public()
        ->autoconfigure()
        ->exclude(['../Prototype/OtherDir', '../Prototype/BadClasses', '../Prototype/SinglyImplementedInterface', '../Prototype/StaticConstructor'])
        ->factory('f')
        ->deprecate('vendor/package', '1.1', '%service_id%')
        ->args([0])
        ->args([1])
        ->autoconfigure(false)
        ->tag('foo')
        ->parent('foo');
    $di->set('foo')->lazy()->abstract()->public();
    $di->get(Prototype\Foo::class)->lazy(false);
};
param('validator.mapping.cache.file'),
                service('cache.validator'),
            ])

        ->set('validator.validator_factory', ContainerConstraintValidatorFactory::class)
            ->args([
                abstract_arg('Constraint validators locator'),
            ])

        ->load('Symfony\Component\Validator\Constraints\\', $validatorsDir.'/*Validator.php')
            ->exclude($validatorsDir.'/ExpressionLanguageSyntaxValidator.php')
            ->abstract()
            ->tag('container.excluded')
            ->tag('validator.constraint_validator')

        ->set('validator.expression', ExpressionValidator::class)
            ->args([service('validator.expression_language')->nullOnInvalid()])
            ->tag('validator.constraint_validator', [
                'alias' => 'validator.expression',
            ])

        ->set('validator.expression_language', ExpressionLanguage::class)
            ->args([service('cache.validator_expression_language')->nullOnInvalid()])
            
namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\RateLimiter\RateLimiterFactory;

return static function DContainerConfigurator $container) {
    $container->services()
        ->set('cache.rate_limiter')
            ->parent('cache.app')
            ->tag('cache.pool')

        ->set('limiter', RateLimiterFactory::class)
            ->abstract()
            ->args([
                abstract_arg('config'),
                abstract_arg('storage'),
                null,
            ])
    ;
};


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 Symfony\Component\Security\Http\EventListener\PasswordMigratingListener;
use Symfony\Component\Security\Http\EventListener\SessionStrategyListener;
use Symfony\Component\Security\Http\EventListener\UserCheckerListener;
use Symfony\Component\Security\Http\EventListener\UserProviderListener;
use Symfony\Component\Security\Http\Firewall\AuthenticatorManagerListener;

return static function DContainerConfigurator $container) {
    $container->services()

        // Manager         ->set('security.authenticator.manager', AuthenticatorManager::class)
            ->abstract()
            ->args([
                abstract_arg('authenticators'),
                service('security.token_storage'),
                service('event_dispatcher'),
                abstract_arg('provider key'),
                service('logger')->nullOnInvalid(),
                param('security.authentication.manager.erase_credentials'),
                param('security.authentication.hide_user_not_found'),
                abstract_arg('required badges'),
            ])
            ->tag('monolog.logger', ['channel' => 'security'])

        
->alias('assets._default_package', 'assets.empty_package')

        ->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'),
                
use Symfony\Bundle\SecurityBundle\LoginLink\FirewallAwareLoginLinkHandler;
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([
                


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'])
    ;
};
namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\Notifier\Bridge;
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
use Symfony\Component\Notifier\Transport\NullTransportFactory;

return static function DContainerConfigurator $container) {
    $container->services()

        ->set('notifier.transport_factory.abstract', AbstractTransportFactory::class)
            ->abstract()
            ->args([service('event_dispatcher')service('http_client')->ignoreOnInvalid()])

        ->set('notifier.transport_factory.brevo', Bridge\Brevo\BrevoTransportFactory::class)
            ->parent('notifier.transport_factory.abstract')
            ->tag('texter.transport_factory')

        ->set('notifier.transport_factory.slack', Bridge\Slack\SlackTransportFactory::class)
            ->parent('notifier.transport_factory.abstract')
            ->tag('chatter.transport_factory')

        ->set('notifier.transport_factory.linked-in', Bridge\LinkedIn\LinkedInTransportFactory::class)
            
->set('container.get_routing_condition_service', \Closure::class)
            ->public()
            ->factory([\Closure::class, 'fromCallable'])
            ->args([
                [tagged_locator('routing.condition_service', 'alias'), 'get'],
            ])
            ->tag('routing.expression_language_function', ['function' => 'service'])

        // inherit from this service to lazily access env vars         ->set('container.env', LazyString::class)
            ->abstract()
            ->factory([LazyString::class, 'fromCallable'])
            ->args([
                service('container.getenv'),
            ])
        ->set('config_builder.warmer', ConfigBuilderCacheWarmer::class)
            ->args([service(KernelInterface::class)service('logger')->nullOnInvalid()])
            ->tag('kernel.cache_warmer')

        ->set('clock', Clock::class)
        ->alias(ClockInterface::class, 'clock')
        ->alias(PsrClockInterface::class, 'clock')

        
<?php
namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use App\BarService;

return function DContainerConfigurator $c) {
    $c->services()
        ->set('bar', 'Class1')->public()
        ->set(BarService::class)
            ->public()
            ->abstract(true)
            ->lazy()
        ->set('foo')
            ->parent(BarService::class)
            ->public()
            ->decorate('bar', 'b', 1)
            ->args([service('b')])
            ->class('Class2')
            ->file('file.php')
            ->parent('bar')
            ->parent(BarService::class)
    ;
};
->args([
                service('security.untracked_token_storage'),
                [],
                abstract_arg('Provider Key'),
                service('logger')->nullOnInvalid(),
                service('event_dispatcher')->nullOnInvalid(),
                service('security.authentication.trust_resolver'),
            ])
            ->tag('monolog.logger', ['channel' => 'security'])

        ->set('security.logout_listener', LogoutListener::class)
            ->abstract()
            ->args([
                service('security.token_storage'),
                service('security.http_utils'),
                abstract_arg('event dispatcher'),
                [], // Options             ])

        ->set('security.logout.listener.session', SessionLogoutListener::class)
            ->abstract()

        ->set('security.logout.listener.clear_site_data', ClearSiteDataLogoutListener::class)
            
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'])

        // Message encoding/decoding         ->set('messenger.transport.symfony_serializer', Serializer::class)
            ->args([
                service('serializer'),
                
Home | Imprint | This part of the site doesn't use cookies.