private example

->call('setBar', [service('foo2')->nullOnInvalid()])
        ->call('setBar', [service('foo3')->ignoreOnInvalid()])
        ->call('setBar', [service('foobaz')->ignoreOnInvalid()])
        ->call('setBar', [expr('service("foo").foo() ~ (container.hasParameter("foo") ? parameter("foo") : "default")')]);

    $s->set('foo_with_inline', 'Foo')
        ->call('setBar', [service('inlined')]);

    $s->set('inlined', 'Bar')
        ->property('pub', 'pub')
        ->call('setBaz', [service('baz')])
        ->private();

    $s->set('baz', 'Baz')
        ->call('setFoo', [service('foo_with_inline')]);

    $s->set('request', 'Request')
        ->synthetic();

    $s->set('configurator_service', 'ConfClass')
        ->private()
        ->call('setFoo', [service('baz')]);

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

use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo;

return function DContainerConfigurator $c) {
    $c->import('basic.php');

    $s = $c->services()->defaults()
        ->public()
        ->private()
        ->autoconfigure()
        ->autowire()
        ->tag('t', ['a' => 'b'])
        ->bind(Foo::classservice('bar'))
        ->bind('iterable $foo', tagged_iterator('foo'))
        ->bind('object $baz', inline_service('Baz'))
        ->public();

    $s->set(Foo::class)->args([service('bar')])->public();
    $s->set('bar', Foo::class)->call('setFoo')->autoconfigure(false);
};
->set('cache.app.taggable', TagAwareAdapter::class)
            ->args([service('cache.app')])
            ->tag('cache.taggable', ['pool' => 'cache.app'])

        ->set('cache.system')
            ->parent('cache.adapter.system')
            ->public()
            ->tag('cache.pool')

        ->set('cache.validator')
            ->parent('cache.system')
            ->private()
            ->tag('cache.pool')

        ->set('cache.serializer')
            ->parent('cache.system')
            ->private()
            ->tag('cache.pool')

        ->set('cache.annotations')
            ->parent('cache.system')
            ->private()
            ->tag('cache.pool')

        
abstract_arg('remember me handler'),
                param('kernel.secret'),
                service('security.token_storage'),
                abstract_arg('options'),
                service('logger')->nullOnInvalid(),
            ])
            ->tag('monolog.logger', ['channel' => 'security'])

        // Cache         ->set('cache.security_token_verifier')
            ->parent('cache.system')
            ->private()
            ->tag('cache.pool')
    ;
};
// Validator         ->set('security.validator.user_password', UserPasswordValidator::class)
            ->args([
                service('security.token_storage'),
                service('security.password_hasher_factory'),
            ])
            ->tag('validator.constraint_validator', ['alias' => 'security.validator.user_password'])

        // Cache         ->set('cache.security_expression_language')
            ->parent('cache.system')
            ->private()
            ->tag('cache.pool')

        // Cache Warmers         ->set('security.cache_warmer.expression', ExpressionCacheWarmer::class)
            ->args([
                [],
                service('security.expression_language'),
            ])
            ->tag('kernel.cache_warmer')

        ->set('controller.is_granted_attribute_listener', IsGrantedAttributeListener::class)
            
<?php
namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo;

return function DContainerConfigurator $c) {
    $c->import('basic.php');

    $s = $c->services()->defaults()
        ->public()
        ->private()
        ->autoconfigure()
        ->autowire()
        ->tag('t', ['a' => 'b'])
        ->bind(Foo::classservice('bar'))
        ->bind('iterable $foo', tagged_iterator('foo'))
        ->public();

    $s->set(Foo::class)->args([service('bar')])->public();
    $s->set('bar', Foo::class)->call('setFoo')->autoconfigure(false);
};


        ->set('security.authenticator.expired_login_link_storage', ExpiredSignatureStorage::class)
            ->abstract()
            ->args([
                abstract_arg('cache pool service'),
                abstract_arg('expired login link storage'),
            ])

        ->set('security.authenticator.cache.expired_links')
            ->parent('cache.app')
            ->private()

        ->set('security.authenticator.firewall_aware_login_link_handler', FirewallAwareLoginLinkHandler::class)
            ->args([
                service('security.firewall.map'),
                tagged_locator('security.authenticator.login_linker', 'firewall'),
                service('request_stack'),
            ])
        ->alias(LoginLinkHandlerInterface::class, 'security.authenticator.firewall_aware_login_link_handler')
    ;
};
Home | Imprint | This part of the site doesn't use cookies.