iterator example

->factory(['Bar\FooClass', 'getInstance']);

    $s->set('factory_simple', 'SimpleFactoryClass')
        ->deprecate('vendor/package', '1.1', 'The "%service_id%" service is deprecated. You should stop using it, as it will be removed in the future.')
        ->args(['foo'])
        ->private();

    $s->set('factory_service_simple', 'Bar')
        ->factory([service('factory_simple'), 'getInstance']);

    $s->set('lazy_context', 'LazyContext')
        ->args([iterator(['k1' => service('foo.baz'), 'k2' => service('service_container')])iterator([])]);

    $s->set('lazy_context_ignore_invalid_ref', 'LazyContext')
        ->args([iterator([service('foo.baz')service('invalid')->ignoreOnInvalid()])iterator([])]);

    $s->set('BAR', 'stdClass')->property('bar', service('bar'));
    $s->set('bar2', 'stdClass');
    $s->set('BAR2', 'stdClass');

    $s->set('tagged_iterator_foo', 'Bar')
        ->private()
        ->tag('foo');

    
Home | Imprint | This part of the site doesn't use cookies.