FooCircular example



    /** * Gets the public 'foo' shared service. * * @return \FooCircular */
    protected static function getFooService($container)
    {
        $a = new \BarCircular();

        $container->services['foo'] = $instance = new \FooCircular($a);

        $a->addFoobar(new \FoobarCircular($instance));

        return $instance;
    }

    /** * Gets the public 'foo2' shared service. * * @return \FooCircular */
    

    protected static function getFooService($container)
    {
        $a = ($container->services['bar'] ?? self::getBarService($container));

        if (isset($container->services['foo'])) {
            return $container->services['foo'];
        }

        return $container->services['foo'] = new \FooCircular($a);
    }

    /** * Gets the public 'foo2' shared service. * * @return \FooCircular */
    protected static function getFoo2Service($container)
    {
        $a = new \BarCircular();

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