stack example

<?php
namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Foo;

return function DContainerConfigurator $c) {
    $services = $c->services();

    $services->stack('stack_a', [
        inline_service('stdClass')
            ->property('label', 'A')
            ->property('inner', service('.inner')),
        inline_service('stdClass')
            ->property('label', 'B')
            ->property('inner', service('.inner')),
        inline_service('stdClass')
            ->property('label', 'C'),
    ])->public();

    $services->stack('stack_abstract', [
        


    /** * Registers a stack of decorator services. * * @param InlineServiceConfigurator[]|ReferenceConfigurator[] $services */
    final public function stack(string $id, array $services): AliasConfigurator
    {
        $this->__destruct();

        return $this->parent->stack($id$services);
    }

    /** * Registers a service. */
    final public function __invoke(string $id, string $class = null): ServiceConfigurator
    {
        $this->__destruct();

        return $this->parent->set($id$class);
    }
}


    /** * Registers a stack of decorator services. * * @param InlineServiceConfigurator[]|ReferenceConfigurator[] $services */
    final public function stack(string $id, array $services): AliasConfigurator
    {
        $this->__destruct();

        return $this->parent->stack($id$services);
    }

    /** * Registers a service. */
    final public function __invoke(string $id, string $class = null): ServiceConfigurator
    {
        $this->__destruct();

        return $this->parent->set($id$class);
    }
}
Home | Imprint | This part of the site doesn't use cookies.