$container =
new ContainerBuilder();
$container ->
register('foo', FooClass::
class) ->
addTag('foo',
['foo' => 'foo'
]) ->
addTag('foo',
['bar' => 'bar', 'baz' => 'baz'
]) ->
addTag('nullable',
['bar' => 'bar', 'baz' => null
]) ->
addTag('foo',
['name' => 'bar', 'baz' => 'baz'
]) ->
setFactory(['Bar\\FooClass', 'getInstance'
]) ->
setArguments(['foo',
new Reference('foo.baz'
),
['%foo%' => 'foo is %foo%', 'foobar' => '%foo%'
], true,
new Reference('service_container'
)]) ->
setProperties(['foo' => 'bar', 'moo' =>
new Reference('foo.baz'
), 'qux' =>
['%foo%' => 'foo is %foo%', 'foobar' => '%foo%'
]]) ->
addMethodCall('setBar',
[new Reference('bar'
)]) ->
addMethodCall('initialize'
) ->
setConfigurator('sc_configure'
) ->
setPublic(true
);
$container ->
register('foo.baz', '%baz_class%'
) ->
setFactory(['%baz_class%', 'getInstance'
]) ->
setConfigurator(['%baz_class%', 'configureStatic1'
]) ->
setPublic(true
);
$container