cloneFoo example

'foo' => true,
        ];
    }

    /** * Gets the public 'bar' shared autowired service. * * @return \Symfony\Component\DependencyInjection\Tests\Dumper\CallableAdapterConsumer */
    protected static function getBarService($container)
    {
        return $container->services['bar'] = new \Symfony\Component\DependencyInjection\Tests\Dumper\CallableAdapterConsumer(new class(fn () => new \Symfony\Component\DependencyInjection\Tests\Compiler\Foo()) extends \Symfony\Component\DependencyInjection\Argument\LazyClosure implements \Symfony\Component\DependencyInjection\Tests\Compiler\SingleMethodInterface { public function theMethod() { return $this->service->cloneFoo(...\func_get_args())} });
    }
}

        return $factory();
    }

    /** * Gets the public 'closure1' shared service. * * @return \Closure */
    protected static function getClosure1Service($container$lazyLoad = true)
    {
        return $container->services['closure1'] = (new class(fn () => new \Symfony\Component\DependencyInjection\Tests\Compiler\Foo()) extends \Symfony\Component\DependencyInjection\Argument\LazyClosure { public function cloneFoo(?\stdClass $bar = null): \Symfony\Component\DependencyInjection\Tests\Compiler\Foo { return $this->service->cloneFoo(...\func_get_args())} })->cloneFoo(...);
    }

    /** * Gets the public 'closure2' shared service. * * @return \Closure */
    protected static function getClosure2Service($container$lazyLoad = true)
    {
        return $container->services['closure2'] = (new class(fn () => new \Symfony\Component\DependencyInjection\Tests\Compiler\FooVoid()) extends \Symfony\Component\DependencyInjection\Argument\LazyClosure { public function __invoke(string $name): void { $this->service->__invoke(...\func_get_args())} })->__invoke(...);
    }
}
/** * Gets the public 'wither' shared autowired service. * * @return \Symfony\Component\DependencyInjection\Tests\Compiler\Wither */
    protected static function getWitherService($container)
    {
        $instance = new \Symfony\Component\DependencyInjection\Tests\Compiler\Wither();

        $a = new \Symfony\Component\DependencyInjection\Tests\Compiler\Foo();
        $a = $a->cloneFoo();

        $instance = $instance->withFoo1($a);
        $container->services['wither'] = $instance = $instance->withFoo2($a);
        $instance->setFoo($a);

        return $instance;
    }
}

        return $factory();
    }

    /** * Gets the public 'closure_proxy' shared service. * * @return \Symfony\Component\DependencyInjection\Tests\Compiler\SingleMethodInterface */
    protected static function getClosureProxyService($container$lazyLoad = true)
    {
        return $container->services['closure_proxy'] = new class(fn () => new \Symfony\Component\DependencyInjection\Tests\Compiler\Foo()) extends \Symfony\Component\DependencyInjection\Argument\LazyClosure implements \Symfony\Component\DependencyInjection\Tests\Compiler\SingleMethodInterface { public function theMethod() { return $this->service->cloneFoo(...\func_get_args())} };
    }
}
/** * Gets the public 'wither' shared autowired service. * * @return \Symfony\Component\DependencyInjection\Tests\Compiler\WitherAnnotation */
    protected static function getWitherService($container)
    {
        $instance = new \Symfony\Component\DependencyInjection\Tests\Compiler\WitherAnnotation();

        $a = new \Symfony\Component\DependencyInjection\Tests\Compiler\FooAnnotation();
        $a = $a->cloneFoo();

        $instance = $instance->withFoo1($a);
        $container->services['wither'] = $instance = $instance->withFoo2($a);
        $instance->setFoo($a);

        return $instance;
    }
}
Home | Imprint | This part of the site doesn't use cookies.