WitherAnnotation example

'Symfony\\Component\\DependencyInjection\\Tests\\Compiler\\FooAnnotation' => true,
        ];
    }

    /** * 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.