3 use Symfony\Component\DependencyInjection\ContainerBuilder;
4 use Symfony\Component\DependencyInjection\Definition;
5 use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
6 use Symfony\Component\DependencyInjection\Reference;
8 $container = new ContainerBuilder();
10 $container->setParameter('env(BAR)', 'bar');
12 $container->register('foo', 'stdClass')->setPublic(true)
13 ->addArgument(new Reference('bar_%env(BAR)%'))
14 ->addArgument(array('baz_%env(BAR)%' => new Reference('baz_%env(BAR)%')));
16 $container->register('bar', 'stdClass')->setPublic(true)
17 ->addArgument(new Reference('bar_%env(BAR)%'));
19 $container->register('bar_%env(BAR)%', 'stdClass')->setPublic(false);
20 $container->register('baz_%env(BAR)%', 'stdClass')->setPublic(false);