LazyClosureConsumer example


        return true;
    }

    /** * Gets the public 'bar' shared autowired service. * * @return \Symfony\Component\DependencyInjection\Tests\Dumper\LazyClosureConsumer */
    protected static function getBarService($container)
    {
        return $container->services['bar'] = new \Symfony\Component\DependencyInjection\Tests\Dumper\LazyClosureConsumer(#[\Closure(name: 'foo', class: 'Symfony\\Component\\DependencyInjection\\Tests\\Compiler\\Foo')] fn () => ($container->services['foo'] ??= new \Symfony\Component\DependencyInjection\Tests\Compiler\Foo()), ($container->services['baz'] ?? self::getBazService($container)), ($container->services['foo'] ??= new \Symfony\Component\DependencyInjection\Tests\Compiler\Foo())->cloneFoo(...), ($container->services['my_callable'] ??= new \Symfony\Component\DependencyInjection\Tests\Compiler\MyCallable())->__invoke(...));     }

    /** * Gets the public 'baz' shared service. * * @return \Closure */
    protected static function getBazService($container)
    {
        return $container->services['baz'] = \var_dump(...);
    }

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