instanceof.php 610 B

12345678910111213141516171819202122
  1. <?php
  2. namespace Symfony\Component\DependencyInjection\Loader\Configurator;
  3. use App\FooService;
  4. use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype;
  5. return function (ContainerConfigurator $c) {
  6. $s = $c->services();
  7. $s->instanceof(Prototype\Foo::class)
  8. ->property('p', 0)
  9. ->call('setFoo', array(ref('foo')))
  10. ->tag('tag', array('k' => 'v'))
  11. ->share(false)
  12. ->lazy()
  13. ->configurator('c')
  14. ->property('p', 1);
  15. $s->load(Prototype::class.'\\', '../Prototype')->exclude('../Prototype/*/*');
  16. $s->set('foo', FooService::class);
  17. };