tikiwiki/packages/tiki-pkg-tikimanager/symfony/dependency-injection/Tests/Fixtures/containers/container21.php

22 lines
548 B
PHP
Raw Permalink Normal View History

2023-11-20 21:52:04 +01:00
<?php
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
$container = new ContainerBuilder();
$bar = new Definition('Bar');
$bar->setConfigurator([new Definition('Baz'), 'configureBar']);
$fooFactory = new Definition('FooFactory');
$fooFactory->setFactory([new Definition('Foobar'), 'createFooFactory']);
$container
->register('foo', 'Foo')
->setFactory([$fooFactory, 'createFoo'])
->setConfigurator([$bar, 'configureFoo'])
->setPublic(true)
;
return $container;